如何在 Visual Studio Code 中自定义 HTML 模板道具的颜色? [英] How to customize color of HTML template props in Visual Studio Code?

查看:44
本文介绍了如何在 Visual Studio Code 中自定义 HTML 模板道具的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用

Inspecting the mustache content in the below code with Developer: Inspect TM scopes

<p>name: {{ name }}</p>

I get text.html.basic, meaning there is no separate scope for changing the color of name inside the mustache tags. Is there any other way of changing the color of template props in Visual Studio Code?

解决方案

If you don't find a better way with scopes, you could try the highlight extension.

And this setting seems to work:

"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
     ],
}

这篇关于如何在 Visual Studio Code 中自定义 HTML 模板道具的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆