dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
494 stars 191 forks source link

Find All References - Showing razor__virtual.cs instead of actual References #9369

Open garrettlondon1 opened 1 year ago

garrettlondon1 commented 1 year ago

Environment data

dotnet --info output: .net 7.0.401 VS Code version: latest C# Extension version: 2.4.4

When looking for references in code behind file of a Blazor Server Razor component, I expect to be able to see all the references that are calling the method.

image

Using C# Extension 2.4.4

dibarbet commented 1 year ago

@davidwengier do we need to include the razor span mapping service on the Roslyn side here? Or should Razor be mapping these values via a middleware

davidwengier commented 1 year ago

We definitely don't have the Razor span mapping service, and that causes a bunch of limitations in various features. As far as I know we haven't talked about how and when we're going to try to address them. https://github.com/dotnet/razor/issues/6919 and https://github.com/dotnet/razor/issues/8845 are the tracking issues for it I guess, though thats more about when we switch to using source generators. VS Code is essentially already in that world, even though it doesn't use source generators :)

davidwengier commented 1 year ago

I'm going to move this to the Razor repo so we can better track with the bigger issues I linked above.