vscode不会自动更改关键字的颜色,即使它们被我自己的扩展程序成功捕获

发布于 2025-02-13 13:44:14 字数 865 浏览 0 评论 0原文

我正在尝试开发一个VSCODE扩展,以调整自己的语言。

如图所示,VSCODE已经捕获了评论和关键字,但是只有评论的颜色自动更改,而关键字的颜色则没有。

这是语法

"scopeName": "source.rosita",
"fileTypes": ["rosita"],
"name": "rosita",
"patterns": [
    {   "include": "#comments"  },
    {   "include": "#keywords"  }
],
"repository": {
    "comments": {
        "comment": "% comment",
        "patterns": [
            {
                "name" : "comment.rosita",
                "match": "%.*"
            }
        ]
    },
    "keywords": {
        "patterns": [
            {
                "name" : "keywords.general.rosita",
                "match": "\\b(?:GIDIR|GODIR|GTDIR)\\b"
            }
        ]
    }
}

I am trying to develop a VScode extension to adapt my own language.

VScode has already captured the comments and the keywords, as the picture shows, but only the color of comments is automatically changed, while that of keywords are not.
enter image description here

This is the syntaxes .json

"scopeName": "source.rosita",
"fileTypes": ["rosita"],
"name": "rosita",
"patterns": [
    {   "include": "#comments"  },
    {   "include": "#keywords"  }
],
"repository": {
    "comments": {
        "comment": "% comment",
        "patterns": [
            {
                "name" : "comment.rosita",
                "match": "%.*"
            }
        ]
    },
    "keywords": {
        "patterns": [
            {
                "name" : "keywords.general.rosita",
                "match": "\\b(?:GIDIR|GODIR|GTDIR)\\b"
            }
        ]
    }
}

Could somebody explain what's going on?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文