Renaming a class does not rename the file
For some time now ReSharper 5.0 has not been renaming the clas file when I rename a class. This is happening in both VS2010 and VS2008.
Did I somehow get a setting turned on/off which is preventing this from happening?
Steps to reproduce:
* Hit F2 on the class name for the RenameClass refactoring.
* Ctrl+Shift+L To see the current file in solution explorer.
* I do not see the filename changed.
Any help is appreciated.
Please sign in to leave a comment.
Hello,
Is the option for renaming the file on?
—
Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”
If I right-click on the file in the Solution Explorer I can rename the file. I am not sure if that is what you were asking.
Is there some ReSharper option for the rename refactoring to also rename the file itself? I looked but could not find anything in the options.
Hello,
Yes, a checkbox on the Rename dialog itself.
It could be missing in certain scenarios (R# could think it's N/A in some
context), but generally it's there.
—
Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”
Ugh. Why did I never notice that check box? "Synchronize file names accordingly to changes"
I think I do know how I accidentally switched it off some time. The text is a label for the checkbox and the clickable region of the label extends across the whole dialog. Thus when mis-targeting a mouse click on the Next button. You can toggle the Sync and Search in comments check boxes. That preference is then remembered. Not a big deal but it bit me for a short while apparently.
Thanks very much for your help.
Ha, I just fell into the same pitfall. You just quickly learn to ingore those checkboxes when renaming stuff frequently.
Hello Jim.
Are you able to reproduce the same issue in a newly created solution?
Thanks!
There is no issue. The only issue might be usabilty, as poeple tend to not see those checkboxes in the rename message box.