Komodo Hacks: Rename Occurrences
This Komodo hack allows you to rename all occurrences of a variable or method name wherever it appears in your code. This is the last of my macros this week that uses Bicycle Repair Man; if you missed my previous post on how to get the BRM package into Komodo, it can be found here.
You can download the macro here. Install it into Komodo by using the Import Package option under the Toolbox menu.
Usage notes:
You can download the macro here. Install it into Komodo by using the Import Package option under the Toolbox menu.
Usage notes:
- Highlight a variable or method in your code and double-click on the Rename macro in the toolbox. The macro will prompt you for the new variable or method name and then perform the rename operation.
- Before refactoring, Komodo will prompt you to save your file if necessary. (This is a requirement of BRM.)
- After refactoring, Komodo will tell you that your file or files have changed and prompt you to reload them. Go ahead! You should see your changes in the updated file(s). If you don't like what you see, you can Undo the changes, via the Edit menu or CTRL-Z.
- Rename Occurrences may not always work like you expect. As an example, you'll want to rename method names where they are originally defined; otherwise, the renaming will only be local and not propagate throughout your code.
Labels: hacks, komodo, python, refactoring
