When using the rename tool in CodeRush for Roslyn and renaming a namespace alias "MyAlias" below, such as:
using MyAlias = My.Other.NameSpace.DontTouchThis.OhNoes
It will rename the aliased namespace that the alias refers to throughout the entire solution instead of only renaming the alias. (It does at least rename the alias, too.)
CodeRush Classic works fine. CR for Roslyn screws everything up by changing my whole solution. :(
Hi Jason,
First, I would like to clarify that CR for Roslyn doesn't provide its own "Rename" refactoring. As the Visual Studio "Rename" refactoring was executed from the Quick Action popup menu on your side, we are not able to fix anything inside it.
Nevertheless, let's see what you have going on. I have tried to reproduce the issue, but all seems to work fine on my side. I have attached a screencast showing it in action. The alias and namespace are renamed separately from each other. Renaming the namespace produces changes of the namespace throughout the project. This behavior is normal.
Maybe, I have misunderstood from your description what behavior you consider erroneous. Would you please provide a small screencast showing the problem? To prepare it, you can use the Jing tool. Please refer to the following link to download it:
http://www.techsmith.com/download/jing/
Here's the screencast of me going into CR for Roslyn options with CR Classic disabled and showing you the hotkey I bound to it. It does exist, but it's just not a default binding. I had to create a hotkey, then I picked the command "Rename" to tie it to.
I missed the fact that it didn't correctly identify the Alias as the item I wanted to rename. When I made the screencast I noticed that it popped the renamer onto the target aliased namespace instead of the actual alias even though I had my edit caret in the alias. It's still a bug, just turns out that it's not the bug I thought it was because I use the renamer so often that I just start typing.
I don't like Popups when renaming. It breaks my flow. That's why I'm using 3rd party refactoring tools instead of the ones built into VS, after all.
Enabling CR Classic and doing it works as I would expect (I just did it again to verify I'm not talking out of my butt). I've done it tons of times which is why I'd just started typing when I used CR for Roslyn. Unfortunately that had broad impact because I'd happened to modify an "alias" for a namespace I used all over my very large solution. Had I just started working, not a problem and I would have just discarded changes en masse. But I had already modified many files so I had to go through each one individually and discard line by line.
I also don't use the quick action popup for Rename. CR Classic has slow action popup instead of quick action popup so I made sure I bypassed it as often as I could by just binding hotkeys to the options I used most frequently.
Jason, thank you for the detailed description.
We're concerned to hear that you're facing this problem. Currently, we're able to reproduce the issue and as soon as we find an appropriate solution, we will update this thread. Please bear with us, your patience is greatly appreciated.