Rename Symbol `F2` doesn’t work in Razor templates
Transferred from https://github.com/OmniSharp/omnisharp-vscode/issues/5419
Issue Description
Renaming a symbol using F2 renames symbols only in .cs files but doesn’t update Razor templates. This requires you to remember to manually change all Razor templates. The server fails to start up and lets you know where you messed up but I got caught by this too many times.
Steps to Reproduce
- Create a class
- Use it in a Razor template
- Rename the class in your
.csusing F2
Expected Behavior
All occurrences are renamed
Actual Behavior
Only occurrences in .cs files are renamed. Razor templates are ignored and need to be manually changed.
Environment information
VSCode version: 1.72.2 C# Extension: 1.25.0 .NET SDK: 6.0.401 (0906eae6f8)
it looks like we is calling the Razor middleware to remap rename text edits - is there something missing on the razor end? https://github.com/OmniSharp/omnisharp-vscode/blob/master/src/features/renameProvider.ts#L40
For @allisonchou to follow up post VS Code insertion.
This is still a bug post-VS code insertion. Rename works if the Razor file and underlying C# file are open but fails if the Razor file is closed. Moving to triage.
This should be fixed in the next C# release