Map component start tags to C#, for better GTD, FAR, Hover, etc.#12287
Merged
davidwengier merged 13 commits intodotnet:mainfrom Oct 8, 2025
Merged
Map component start tags to C#, for better GTD, FAR, Hover, etc.#12287davidwengier merged 13 commits intodotnet:mainfrom
davidwengier merged 13 commits intodotnet:mainfrom
Conversation
…ver actually needs this
Fixes old "Component" test
Member
DustinCampbell
left a comment
There was a problem hiding this comment.
Very nice change! I really appreciate the extra commit demonstrating the test baseline updates before the giant commit that updates all of them.
...Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Intermediate/ComponentIntermediateNode.cs
Outdated
Show resolved
Hide resolved
...rosoft.CodeAnalysis.Razor.Compiler/src/Language/DefaultRazorIntermediateNodeLoweringPhase.cs
Show resolved
Hide resolved
...ompiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentNodeWriter.cs
Outdated
Show resolved
Hide resolved
...ompiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentNodeWriter.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/TypeNameHelper.cs
Outdated
Show resolved
Hide resolved
Comment on lines
+558
to
+564
| var lastColon = nonGenericTypeName.Span.LastIndexOf(':'); | ||
| if (lastColon > -1) | ||
| { | ||
| lastColon++; | ||
| context.CodeWriter.Write(nonGenericTypeName[0..lastColon]); | ||
| nonGenericTypeName = nonGenericTypeName.Slice(lastColon); | ||
| } |
Member
There was a problem hiding this comment.
Any reason not to just check nonGenericTypeName.Span.StartsWith("global::".AsSpan(), StringComparison.Ordinal) to be certain that we're looking at global::?
Member
Author
There was a problem hiding this comment.
No strong reason, this method just doesn't actually care what the alias is.
...ompiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentNodeWriter.cs
Show resolved
Hide resolved
...isualStudio.LanguageServices.Razor.Test/Cohost/Shared/CohostFindAllReferencesEndpointTest.cs
Outdated
Show resolved
Hide resolved
Member
Author
|
@dotnet/razor-tooling would be good to get some more eyes on this |
chsienki
approved these changes
Oct 7, 2025
This was referenced Oct 15, 2025
davidwengier
added a commit
to davidwengier/razor
that referenced
this pull request
Nov 14, 2025
…tc. (dotnet#12287)" This reverts commit d8cb5e5, reversing changes made to c8a8e7f.
davidwengier
added a commit
that referenced
this pull request
Nov 14, 2025
davidwengier
added a commit
that referenced
this pull request
Nov 14, 2025
…over, etc. (#12287) (#12486) Backport of #12485 to main /cc @davidwengier ## Customer Impact ## Regression - [ ] Yes - [ ] No [If yes, specify when the regression was introduced. Provide the PR or commit if known.] ## Testing [How was the fix verified? How was the issue missed previously? What tests were added?] ## Risk [High/Medium/Low. Justify the indication by mentioning how risks were measured and addressed.]
davidwengier
added a commit
that referenced
this pull request
Nov 19, 2025
Fixes #12276 again Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2633418 Commit-at-a-time is thoroughly recommended. Commits 1-4 expose a DocumentExcerpt service that Roslyn can use to provide nice results in FAR etc., because without the code-gen changes, the generated code is pretty ugly. Commit 5 "reverts" #12486, bringing #12287 back but _without_ any changes to the code-gen this time, just a new source mapping. Commit 6 is test baseline updates (only source mappings, no .cs files) Commit 7 removes the requirement for line pragmas to exactly match source mappings. I left the rest of the validation though Commit 8 bumps us to a new Roslyn with the new document excerpt services.
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.
Fixes #12276
Closes #12105 though not quite doing everything that issue entails, it does the main bit (using Roslyn more)
This change is across compiler and tooling so change-at-a-time probably makes the most sense. The story is basically updating the compiler, then the test baselines, then individual tooling changes to fix things broken by the compiler change. The actual feature improvement in tooling was essentially free :)