Sam*_*ver 4 visual-studio-code
VS Code 允许用户为. settings.json最灵活的方法是使用属性"textMateRules",其格式如下:
"editor.tokenColorCustomizations": {
"textMateRules": [{
"scope": ["keyword.other", "keyword.control"],
"settings": {
"foreground": "#FF0000",
"fontStyle": "bold"
}
}]
}
Run Code Online (Sandbox Code Playgroud)
上述代码片段的问题在于它将所选样式应用于任一keyword.otherORkeyword.control范围。是否可以设计一个textMateRules需要keyword.otherANDkeyword.control范围的配置?
使用此表格:
"editor.tokenColorCustomizations": {
"textMateRules": [{
"scope": "keyword.other keyword.control",
"settings": {
"foreground": "#FF0000",
"fontStyle": "bold"
}
}]
}
Run Code Online (Sandbox Code Playgroud)
"scope": "keyword.other keyword.control", // note separated by a space, one string
此表格需要两个范围都存在才能应用。
| 归档时间: |
|
| 查看次数: |
2715 次 |
| 最近记录: |