Update references in .razor files along with .cs files when renaming
This issue has been moved from a ticket on Developer Community.
One of the useful features in Visual Studio is right-click + Rename. It automatically renames all references to that class name, variable name, method name, etc. However it doesn't seem to do so when that reference is in the razor code of a .razor file (note: I'm not referring in the @code section but that may be the case as well). It leaves the old name. I imagine this is related to why references don't show up when I choose "Show All References" if those references are in a .razor file.
I don't know if this is a bug report or a feature request since I don't know if it should be working but it would be great if it did.
Steps to reproduce:
- Have a file and its .cs code-behind file. Maybe have some other classes that are referenced in the .razor file.
- Right-click + Rename a variable in the .cs file (alternatively in one of the other classes referenced in the .razor file)
Expected behavior: the references in the .razor file are also updated along with all the references in the .cs files.
Actual behavior: only the references in the .cs files are updated. Any references in razor code remain unchanged and the next build will fail since the renamed items can no longer be referenced by their old names.
Original Comments
Feedback Bot on 9/24/2021, 01:54 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.