Skip to content

Conversation

@davidwengier
Copy link
Member

Fixes #8541
Fixes #11493

Needs dotnet/roslyn#81549 before this will build, but Roslyn CI seems to be having issues, so putting this up while we wait.

This implements workspace/willRenameFiles support in our LSP server, so that when a .razor file is renamed, we perform a full rename of the component, including updating component tags and getting Roslyn changes for renaming the class name. In VS we also include a poly-fill since willRenameFiles is not supported, and an extra "apply rename" method to fill in the difference between real willRenameFiles support, where edits are made before file renames, and our polyfill which lets CPS handle the file rename, and applies the edits afterwards.

VS:
VSRenameRazorFile

VS Code:
VSCodeRazorFile

@davidwengier davidwengier requested a review from a team as a code owner December 8, 2025 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto rename partial class in code-behind on rename Allow developers to properly rename razor components in the editor

1 participant