Skip to content

Support inlay hints#2357

Merged
333fred merged 7 commits intoOmniSharp:masterfrom
333fred:inlay-hints
Mar 17, 2022
Merged

Support inlay hints#2357
333fred merged 7 commits intoOmniSharp:masterfrom
333fred:inlay-hints

Conversation

@333fred
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread src/OmniSharp.Roslyn.CSharp/Services/InlayHints/InlayHintService.cs
Comment thread src/OmniSharp.Abstractions/Models/v1/InlayHints/InlayHintRequest.cs Outdated
return request.Hint;
}

var descriptionTags = await roslynHint.GetDescrptionAsync(document, CancellationToken.None);
Copy link
Copy Markdown
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

filipw and others added 3 commits March 17, 2022 07:05
…ce.cs

Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
…st.cs

Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
Copy link
Copy Markdown
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
Copy Markdown
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