Can't rename a local variable with Refactor|Rename?

Ok, it did rename the local variable, but…

I tried to rename a local variable (that was referenced a bunch of places in that local method). It only let me rename that one place. Hardly seems worth a menu item if it doesn’t do more than that.

Should it change ALL variable references in that method to the new name?

… time passes …

I think I see what is going on.

Here was the code:

  var 
     RelatedCategoryInformation : RelatedCategoryInformation;
  
  procedure GetCategoryLabels;
     begin
     Categories.Category1Label := RelatedCategoryInformation.Category1Label;
     Categories.Category2Label := RelatedCategoryInformation.Category2Label;

I tried to rename the RelatedCategoryInformation VARIABLE on the LEFT side of the var declaration, but I think it gets confused by the fact that there is a CLASS by that name. If I change the name of all the variables to aRelatedCategoryInformation, then the rename works for all of them.

I think this might be a bug.

Possibly, do you have a more complete case that shows this?

Here is a test case. Try to Refactor/Rename the myclass on the left side in line 34 of Window1.xaml.pas.

RenameProblem.zip (118.2 KB)

Thanks, logged as bugs://72371

bugs://72371 got closed with status fixed.