是否有办法使 meta.function-call
文本配合规则优先于 entity.name.function
?
在 VS Code Crystal(类 Ruby 语言)中,设置用 entity.name.function
标记标记的方法定义和方法调用。
我希望方法定义为粗体,但方法调用为非粗体。但它不起作用,因为我无法使用 meta.function-call
entity.name.function
我的setting.json
:
{
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"entity.name.function"
],
"settings": { "foreground": "#3730A3", "fontStyle": "bold" }
},
{
"scope": [
"meta.function-call"
],
"settings": { "foreground": "#111827", "fontStyle": "" }
}
]
}
}
最佳答案
指定由空格分隔的多个范围:
{
"name": "function definition",
"scope": [
"entity.name.function"
],
"settings": {
"foreground": "#ff0000"
}
},
{
"name": "function call",
"scope": [
"meta.function-call entity.name.function"
],
"settings": {
"foreground": "#0000ff"
}
},
关于visual-studio-code - VS Code 突出显示文本配合规则优先级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68758259/