Cohost inlay hint support#10672
Merged
davidwengier merged 15 commits intodotnet:mainfrom Jul 31, 2024
Merged
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.
davidwengier
commented
Jul 25, 2024
Comment on lines
+78
to
+83
| // 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; | ||
| } |
Member
Author
There was a problem hiding this comment.
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.
davidwengier
commented
Jul 25, 2024
src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteWorkspaceAccessor.cs
Outdated
Show resolved
Hide resolved
DustinCampbell
approved these changes
Jul 30, 2024
...crosoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractRazorDocumentMappingService.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextExtensions.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextExtensions.cs
Show resolved
Hide resolved
8 tasks
This was referenced Aug 7, 2024
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.
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:
DocumentMappingServicemethods to useTextChangeinstead ofTextEditso 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.