问题描述
在 VS Code 中是否有人知道如何更改 C++ 变量名称的颜色主题.我可以更改函数、注释、关键字的颜色,但我无法让变量起作用.任何帮助都会很棒谢谢.
in VS Code does anyone know how to change the color theme for variable names for C++. I can change the colors for functions, comments, keywords, but I can't get variables to work. Any help would be great Thanks.
推荐答案
更新:现在可以通过 C++ 扩展来实现.支持@TheBat 的回答,因为他最初发布了更新.范围是 variable.other.local
并且他的回答显示了要添加到您的设置文件中的内容.
UPDATE: this is now possible with the C++ extension. Upvote @TheBat's answer since he originally posted the update. The scope is variable.other.local
and his answer shows what to add to your settings file.
注意:如果您没有扩展名,下面的答案仍然是准确的
NOTE: the answer below is still accurate if you do not have the extension
我是 VS Code C++ 语法的维护者,遗憾的是还没有一种方法可以更改所有 C++ 变量的颜色,Python 语法是相同的方式.您可以更改 source.cpp
的颜色,这将更改默认颜色,并且您可以使用 variable
和 variable.parameter,但这仍然不会影响许多未标记的变量.
I'm the maintainer of the VS Code C++ Syntax, and sadly there is not yet a way to change the color of all C++ variables, the Python syntax is the same way. You can change the color of source.cpp
which will change the default color, and you can change the color of some existing variables with variable
and variable.parameter
, but this will still not affect many of the untagged variables.
我们正在努力改变这一点,但这需要很长时间.对于一般范围名称,请查看 https://macromates.com/manual/en/language_grammars#命名约定
We're working on changing this, but it is going to take quite awhile.For general scope names, look at https://macromates.com/manual/en/language_grammars#naming-conventions
这篇关于VS Code,更改变量的颜色主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!