【发布时间】:2019-03-14 00:24:06
【问题描述】:
使用Developer: Inspect TM scopes检查以下代码中的小胡子内容
<p>name: {{ name }}</p>
我得到text.html.basic,这意味着没有单独的范围可以更改小胡子标签内name 的颜色。有没有其他方法可以改变 Visual Studio Code 中模板道具的颜色?
【问题讨论】:
标签: visual-studio-code vscode-settings
使用Developer: Inspect TM scopes检查以下代码中的小胡子内容
<p>name: {{ name }}</p>
我得到text.html.basic,这意味着没有单独的范围可以更改小胡子标签内name 的颜色。有没有其他方法可以改变 Visual Studio Code 中模板道具的颜色?
【问题讨论】:
标签: visual-studio-code vscode-settings
如果您没有找到更好的使用范围的方法,您可以尝试highlight extension。
而且这个设置似乎有效:
"highlight.regexes": {
"({{[/!^>#]*\\s*)([^}]+)(\\s*}})": [
{}, // first match group "{{" gets no color, must be here
{
// "overviewRulerColor": "#ffcc00",
"color": "#f00",
// "fontWeight": "bold"
},
{} // third match group "}}" gets no color, does not need to be here
],
}
【讨论】:
)。你写它的方式还不如去掉第三种模式。这是一个用于角度道具绑定的:"(\\s+\\[[\\w-]+\\]=\"[/!^>#]*)([^\"]+)"