In my opinion, refactoring is the way to keep a software project clean. So, it’s good to have tools that support the refactoring process.
ReSharper is such a tool. It provides refactoring capabilities for C#/Visual Studio.
Unfortunately, the renaming code in ReSharper currently (version 7.1.1) contains a bug. This bug may prevent ReSharper from renaming all occurrences of a certain symbol.
The following code exhibits this problem:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
using System; public class SomeOtherClass { public string GetString(int col) { return null; } } public class MyClass { public void YouCantRenameMe() { } public void ThisFunctionBreaksTheRenaming() { // The following line breaks the renaming. SomeFunction((row) => row.GetString(0)); } public void SomeFunction<T>(Func<SomeOtherClass, T> func) { YouCantRenameMe(); } } |
If you try to rename the method YouCantRenameMe()
(in line 10), ReSharper won’t rename the method call in line 18.
The problem is the code in method ThisFunctionBreaksTheRenaming()
which somehow breaks the renaming process.
Update: This bug is not present in version 7.1. So, for now, I’ve downgraded to this version.
ReSharper fails because it can’t find symbol usages in this file. Have a look at this bug:
http://youtrack.jetbrains.com/issue/RSRP-336789
Actually, this is the original bug tracker. Appears to have been fixed for a future release.
http://youtrack.jetbrains.com/issue/RSRP-336714