Change variable name in a method


#1

I saw a video on youtube where it was shown how to change a variable name in a method and replace all occurrences. But I can not find it again. How to do it?


#2

If I understand you correctly, you can use the standard Find-and-replace package (Ctrl-F):

Edit:
The difficulty is to distinguish semantically between variable names and other mentions of the same word.


#3

I found it, it id Ctrl + D


#4

You can also give a chance to the Refactor package https://atom.io/packages/refactor
It works much better than the standard Ctrl+D


#5

I tried it, it didn’t work at all. Found this comment by looking for a different option. Ctrl + D does the trick.

I have a bunch of snippets on Alfred that I use to create react components, require packages, etc. Ctrl + D is perfect for replacing placeholder names in those snippets.