Refactor local variable name using Visual Studio Code

后端 未结 4 807
抹茶落季
抹茶落季 2021-02-01 11:51

I have this simple situation. I\'d like to refactor the name of the role variable:

It looks like Visual Studio Code is smart enough to know that \"roles\" in th

4条回答
  •  既然无缘
    2021-02-01 12:15

    Use Rename Symbol. It is defined by default with Ctrl + F2.

    However, keep in mind that the variable, definition, function, etc., that you're changing, will be changed in the file itself, not only the scope. Visual Studio Code for now doesn't have an implementation for renaming a variable in a scope (for example, a variable inside a function). So keep that in mind.

    Visual Studio Code - change all occurrences

提交回复
热议问题