# Wolfram Workbench - how to rename local variables

I'm refactoring some old code. I used really short names for local variables, which I'm coming to regret. Is there an easy way to rename local variables in scope using Wolfram workbench?

Here is an example

How could I change d inside Test, but not in the Print statement?

Test[d_]:=d+1;
(*Some other code*)
Print[d];


Or the same for l inside Module?

Test1[x_]:=Module[{l},l=x+1];
(*Some other code*)
Print[l];


There is a Ctrl+1 QuickFix rename variable, which I discovered while researching this question, but it seems to work only on the whole file...

Using WB 2.0 (anybody even still uses WB 1.1?)

-
@b.gatessucks Because the the d in test and the d in some other module have different functions. This is a simplified example. In real life I have several "functions", which all have the variable data. But in each function I would like to change data to some specific, more meaningful, name. –  Ajasja Jan 16 '13 at 15:51
I would suggest a two stage procedure: first use the refactoring functionality to replace the symbol with one with a longer, unique name for the whole file. Then select each of the Modules and use the standard eclipse search and replace functionality to (string-)replace the unique longer symbol name with the desired new name which will let you act on the selected lines only... –  Albert Retey Jan 16 '13 at 22:42
@AlbertRetey Well, what I'm doing at the moment is copying each module to a temp .m file, do the replacements there and copy back. –  Ajasja Jan 17 '13 at 8:37

Yes, this works in all cases (you have to make sure that scope is set to selected lines). Also whole word and perhaps match case should be set under the options in the find/replace dialog. Then it mimics the rename quite well. –  Ajasja Jan 17 '13 at 8:35
Well, I guess I'll accept the Ctrl+F as the best that can be done. –  Ajasja Jan 21 '13 at 8:58