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?)
d
in test and thed
in some other module have different functions. This is a simplified example. In real life I have several "functions", which all have the variabledata
. But in each function I would like to changedata
to some specific, more meaningful, name. $\endgroup$.m
file, do the replacements there and copy back. $\endgroup$