Skip to content

Conversation

@davidwengier
Copy link
Member

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 :)

@davidwengier davidwengier requested a review from a team as a code owner October 3, 2025 12:47
Copy link
Member

@DustinCampbell DustinCampbell left a 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.

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);
}
Copy link
Member

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::?

Copy link
Member Author

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.

@davidwengier
Copy link
Member Author

@dotnet/razor-tooling would be good to get some more eyes on this

@davidwengier davidwengier merged commit d8cb5e5 into dotnet:main Oct 8, 2025
11 checks passed
@davidwengier davidwengier deleted the GoToDefComponentName branch October 8, 2025 22:54
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Oct 8, 2025
davidwengier added a commit to davidwengier/razor that referenced this pull request Nov 14, 2025
davidwengier added a commit that referenced this pull request Nov 14, 2025
github-actions bot pushed a commit that referenced this pull request Nov 14, 2025
…tc. (#12287)"

This reverts commit d8cb5e5, reversing
changes made to c8a8e7f.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GoToDef doesn't work on component name when implemented in C# Simplify GTD, Hover, FAR etc. in cohosting

3 participants