Introduces a new hover provider, under V2 of the protocol, that uses Roslyn's QuickInfoService#1860
Merged
JoeRobich merged 6 commits intoOmniSharp:masterfrom Jul 25, 2020
Merged
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.
333fred
added a commit
to 333fred/vscode-csharp
that referenced
this pull request
Jul 24, 2020
Hover implemention is in PR here: OmniSharp/omnisharp-roslyn#1860.
Member
|
thanks a lot! I had it on my TODO since it became public in Roslyn 😀 |
filipw
reviewed
Jul 24, 2020
filipw
reviewed
Jul 24, 2020
filipw
reviewed
Jul 24, 2020
| case QuickInfoSectionKinds.TypeParameters: | ||
| return new QuickInfoResponseSection { IsCSharpCode = true, Text = s.Text }; | ||
|
|
||
| default: |
Member
There was a problem hiding this comment.
Should we special case any example as well and emit them as full markdown code blocks?
Contributor
Author
There was a problem hiding this comment.
I don't believe there is an examples section in quickinfo.
bjorkstromm
reviewed
Jul 24, 2020
This was referenced Jul 24, 2020
Rewrite quickinfo loop to be fully iterative and not create closures. Moved the new service to V1. Simplify the output.
Contributor
Author
|
@filipw @david-driscoll @mholo65 addressed feedback, and updated the vscode side as well. |
…ing parts that the client needs to reassemble themselves.
bjorkstromm
approved these changes
Jul 25, 2020
Member
|
Thanks! I've kicked CI since Mac build stalled. |
JoeRobich
approved these changes
Jul 25, 2020
Member
|
Thanks @333fred! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.