-
Notifications
You must be signed in to change notification settings - Fork 195
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
Cohost inlay hint support #10672
Cohost inlay hint support #10672
Conversation
This was done because originally with inlay hints I was changing global options in Roslyn, but ended up moving away from that. Still makes sense though.
// We know this C# maps to Razor, but does it map to Razor that we like? | ||
var node = syntaxTree.Root.FindInnermostNode(hostDocumentIndex); | ||
if (node?.FirstAncestorOrSelf<MarkupTagHelperAttributeValueSyntax>() is not null) | ||
{ | ||
continue; | ||
} |
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.
Annoyingly, this bit of code is pretty much the only logic that could be shared with the existing inlay hints code, because everything else operates on VS LSP types, and here we're using Roslyn LSP types. The code duplication isn't great, but I'm somewhat okay with it because we have good tests for both.
Perhaps we can re-review if/when we can move the language server to Roslyn LSP types, which could be as early as preview 2.
Part of #9519
Needs dotnet/roslyn#74548 before it will compile
Needs https://devdiv.visualstudio.com/DevDiv/_git/VSLanguageServerClient/pullrequest/567229 before it will work in VS
There were a few side quests on this one:
DocumentMappingService
methods to useTextChange
instead ofTextEdit
so I could use Roslyn LSP typesIf reviewing commit-at-a-time please note that the first commit was written before the reworking of extension methods and LSP types, and the fixes for that are in the last commit.