Find All References doesn't work on component type name from C#
Describe the bug: When executing Find All References on a component type in a C# file, we do not navigate to the definition. In < 17.3 P1 Roslyn null-refs (fixed in https://github.com/dotnet/roslyn/pull/61342) but even with that fix, we still fail to show a result, as we fail to map the location Roslyn finds to the Razor document.
Version used: e.g. VS2022 17.3 Preview 1
To reproduce: Steps to reproduce the behavior:
- File, New Project, Blazor Server
- Open SurveyPrompt.razor
- Extract the
@codeblock to a C# file - Right-click on
SurveyPromptclass name in the C# file, and click Find All References
Expected behavior:
We should show the <SurveyPrompt Title="... from the Index.razor file as a result. We could possibly also show the SurveryPrompt.razor file as a result (possibly already reported as https://github.com/dotnet/razor-tooling/issues/7213)
Actual behavior: Crash/Nothing.
Originally reported as https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1537104