VsCode has a command (ctrl+alt+l
as shown here) to select all occurrences of the word in a file. It's also possible for the rename symbol. But is there a way to select only occurrences of the same variable ?
In this example would like to be able to select in the same time the word value
of the first and third line but not the one of the second line.
def square(value):
'''Return the square of provided value.'''
return value * value
You can use
F2
and rename the variable. It will rename only, but all the variable instances in the file. When the cursor is on the variable you want to rename, clickF2
you will see a prompt like this.