英文:
How can I get Python's code coloring for Go code in VS code?
问题
我在vs code中使用的是One Dark Pro主题。当我在编写Python文件时,每个元素都有不同的颜色,非常棒。
在Go文件中,与Python着色有很多相似之处(因为我当然还在使用One Dark Pro),例如def和func都是紫色的,但大部分代码都是纯白色的。
似乎是变量,尽管包和结构体字面量也会变成白色。
有没有办法在Go中获得Python的着色效果?
英文:
I use One Dark Pro in vs code. When I'm writing in a python file, everything has a distinct color, it's wonderful.
In a Go file, there are many similarities to the Python coloring (because of course I'm still using One Dark Pro, for example def and func are both purple) but much of the code is in plain white.
It seems to be variables, though packages and struct literals go white as well.
Is there a way to get the Python coloring in Go?
答案1
得分: 1
在settings.json
文件中进行修改:
// 仅为示例
"editor.tokenColorCustomizations": {
"[Abyss]": {
"textMateRules": [
{
"scope": "meta.function-call",
"settings": {
"foreground": "#ffffff"
}
},
{
"scope": "entity.name.type, entity.name.class, entity.name.namespace, entity.name.scope-resolution",
"settings": {
"fontStyle": ""
}
}
]
}
},
在编写时使用Ctrl + Space,您将获得更多的配置建议。
英文:
Modify in the settings.json
file using:
// Just an example
"editor.tokenColorCustomizations": {
"[Abyss]": {
"textMateRules": [
{
"scope": "meta.function-call",
"settings": {
"foreground": "#ffffff"
}
},
{
"scope": "entity.name.type, entity.name.class, entity.name.namespace, entity.name.scope-resolution",
"settings": {
"fontStyle": ""
}
},
]
}
},
Use Ctrl + Space as you write and you'll get more configuration suggestions to use.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论