-
Notifications
You must be signed in to change notification settings - Fork 229
Map component start tags to C#, for better GTD, FAR, Hover, etc. #12287
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
Conversation
…ver actually needs this
Fixes old "Component" test
DustinCampbell
left a comment
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.
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
| var lastColon = nonGenericTypeName.Span.LastIndexOf(':'); | ||
| if (lastColon > -1) | ||
| { | ||
| lastColon++; | ||
| context.CodeWriter.Write(nonGenericTypeName[0..lastColon]); | ||
| nonGenericTypeName = nonGenericTypeName.Slice(lastColon); | ||
| } |
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.
Any reason not to just check nonGenericTypeName.Span.StartsWith("global::".AsSpan(), StringComparison.Ordinal) to be certain that we're looking at global::?
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.
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
|
@dotnet/razor-tooling would be good to get some more eyes on this |
…tc. (dotnet#12287)" This reverts commit d8cb5e5, reversing changes made to c8a8e7f.
…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.]
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.
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 :)