Ant*_*nok 6 javascript textmate visual-studio-code tmlanguage
VS Code 1.15 添加了对 TextMate 语法规则的支持。我想用这些规则突出显示 JavaScript 中的一些变量:self,me。我怎样才能做到这一点?
简短的回答:你不能。
我假设您指的是新editor.tokenColorCustomizations
设置。此设置仅允许您更改与 TextMate 语法已定义的特定范围关联的颜色。self
并且me
没有被 JS 语法特殊对待,它们使用与variable.other.readwrite.js
任何其他变量相同的作用域:
将此与this
关键字进行对比:它有自己独特的variable.language.this.js
范围,因此我们可以使用该设置将其着色为this
红色:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "variable.language.this.js",
"settings": {
"foreground": "#FF0000"
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4374 次 |
最近记录: |