Skip to content

Conversation

@davidwengier
Copy link
Member

Part of https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2633418

We had to revert some code that made FAR, Hover, Go To Def etc. work in Razor files because to support it we had to add #line mappings for things, and that broke Hot Reload by changing PDB offsets. Who knrew!

This PR enables us to bring back that support without #line directives by allowing locations in Razor source genned documents to be found by FAR even if they're hidden. It also tweaks the LSP source mapping code to drop results that can't be mapped, which actually matches was the VS side already did anyway. Finally it exposes a hook for Razor to implement a document excerpt service, which is something I punted previously because the results with the #line directives were good enough, but now they're really not.

Commit-at-a-time review is probably simpler, to make it clear which change is for which purpose.


namespace Microsoft.CodeAnalysis.Classification;

[DataContract]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is public API, so let me know if this change isn't allowed, and I can create a wrapper in the EA

@davidwengier davidwengier enabled auto-merge (squash) November 18, 2025 03:13
@davidwengier davidwengier merged commit f38878a into dotnet:main Nov 18, 2025
25 of 26 checks passed
@davidwengier davidwengier deleted the RazorFindRefs branch November 18, 2025 03:13
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants