-
Notifications
You must be signed in to change notification settings - Fork 418
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
Introduces a new hover provider, under V2 of the protocol, that uses Roslyn's QuickInfoService #1860
Conversation
…Roslyn's QuickInfoService The existing provider uses a custom handler, which this replaces. Among other benefits, this brings nullability display when available, and ensures that any new additions to roslyn's info get propagated to users of this service. Unfortunately, however, TaggedText in VS is significantly more powerful than vscode's hover renderer: that simply uses markdown. Their implementation does not support any extensions to enable C# formatting of code inline, I created a poor-man's substitute: for the description line, we treat the whole line as C#. It does mean there can be a bit of odd formatting with `(parameter)` or similar, but this exactly mirrors what typescript does so I don't think it's a big deal. For other sections, I picked sections that looked ok when formatted as C# code, and I otherwise did a simple conversion, as best I could, from tagged text to inline markdown.
Hover implemention is in PR here: OmniSharp/omnisharp-roslyn#1860.
thanks a lot! I had it on my TODO since it became public in Roslyn 😀 |
case QuickInfoSectionKinds.TypeParameters: | ||
return new QuickInfoResponseSection { IsCSharpCode = true, Text = s.Text }; | ||
|
||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we special case any example
as well and emit them as full markdown code blocks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe there is an examples section in quickinfo.
Rewrite quickinfo loop to be fully iterative and not create closures. Moved the new service to V1. Simplify the output.
@filipw @david-driscoll @mholo65 addressed feedback, and updated the vscode side as well. |
…ing parts that the client needs to reassemble themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've kicked CI since Mac build stalled. |
Thanks @333fred! |
The existing provider uses a custom handler, which this replaces. Among other benefits, this brings nullability display when available, and ensures that any new additions to roslyn's info get propagated to users of this service. Unfortunately, however, TaggedText in VS is significantly more powerful than vscode's hover renderer: that simply uses markdown. Their implementation does not support any extensions to enable C# formatting of code inline, I created a poor-man's substitute: for the description line, we treat the whole line as C#. It does mean there can be a bit of odd formatting with
(parameter)
or similar, but this exactly mirrors what typescript does so I don't think it's a big deal. For other sections, I picked sections that looked ok when formatted as C# code, and I otherwise did a simple conversion, as best I could, from tagged text to inline markdown.I've submitted a parallel PR to move vscode to use this provider, and provided some samples of what it looks like there: dotnet/vscode-csharp#3928.
Fixes #1860.