Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support inlay hints #2357

Merged
merged 7 commits into from
Mar 17, 2022
Merged

Support inlay hints #2357

merged 7 commits into from
Mar 17, 2022

Conversation

333fred
Copy link
Contributor

@333fred 333fred commented Mar 16, 2022

I've based the O# api on the proposed inlay hint LSP api, https://github.com/microsoft/vscode-languageserver-node/blob/main/protocol/src/common/protocol.inlayHint.ts, which is pretty much stable now and 3.17 should be out shortly with this shape. I've also done a couple of refactors while touching code:

  • Update to C# 10.
  • Add some additional assert utils from roslyn, to make test results more readable and actionable.
  • Add an interpolated string handler for logging, so that interpolated strings can be used in logging without a perf penalty when they're uneeded.

333fred added 2 commits March 15, 2022 23:17
I've based the O# api on the proposed inlay hint LSP api, https://github.com/microsoft/vscode-languageserver-node/blob/main/protocol/src/common/protocol.inlayHint.ts, which is pretty much stable now and 3.17 should be out shortly with this shape. I've also done a couple of refactors while touching code:

* Update to C# 10.
* Add some additional assert utils from roslyn, to make test results more readable and actionable.
* Add an interpolated string handler for logging, so that interpolated strings can be used in logging without a perf penalty when they're uneeded.
Copy link
Member

@JoeRobich JoeRobich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

return request.Hint;
}

var descriptionTags = await roslynHint.GetDescrptionAsync(document, CancellationToken.None);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened dotnet/roslyn#60217 for this typo

Copy link
Member

@filipw filipw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool

@333fred
Copy link
Contributor Author

333fred commented Mar 17, 2022

I need to adjust one test to account for platform differences (int is a readonly struct on some platforms, and that affects the ToString() behavior).

@333fred 333fred enabled auto-merge March 17, 2022 21:14
@333fred 333fred merged commit b1dd617 into OmniSharp:master Mar 17, 2022
@333fred 333fred deleted the inlay-hints branch March 18, 2022 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants