Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
VsCode 有一个命令(ctrl+alt+l如图所示)来选择文件中所有出现的单词。重命名符号也是可能的。但是有没有办法只选择相同变量的出现?
ctrl+alt+l
在此示例中,希望能够同时选择value第一行和第三行的单词,但不能选择第二行的单词。
value
def square(value): '''Return the square of provided value.''' return value * value
您可以使用F2和重命名变量。它只会重命名文件中的所有变量实例。当光标在要重命名的变量上时,单击F2会看到类似这样的提示。
F2