daustin
daustin

Reputation: 623

Visual Studio 2013 vb.net renaming variables not handling case sensitivity

Using Visual Studio 2013 and VB.NET. When renaming variables using the IDE by right-clicking on the variable and selecting Rename it doesn't change references to the variable if it' just a casing change. Example rename _TestDate to _testDate is not propagating the change throughout the file. Am I missing something?

Upvotes: 0

Views: 174

Answers (2)

JayRO-GreyBeard
JayRO-GreyBeard

Reputation: 149

The solution is to do a double-rename, temporarily using an intermediate variable name:

Step 1) rename _TestDate to _XXTestDate

Step 2) rename _XXTestDate to _testDate

Upvotes: 0

Jevgeni Geurtsen
Jevgeni Geurtsen

Reputation: 3133

As specified on Refactoring and Rename Dialog Box (Visual Basic) the location property holds the namespace to search when you perform the rename operation.. The field is disabled, thus you can't enter the namespace you want to look for the name in (which makes sense). In your case, it probably looks in ClassA and completes the renaming there, but it doesn't rename in ClassB. This just isn't possible with the Rename tool of Visual Basic.

There are third party plugins who can do this for you though:

They both have 30 day trials for you to test out..

Upvotes: 1

Related Questions