gpt4 book ai didi

visual-studio-code - VSCode 扩展 : embed standard language in mine

转载 作者:行者123 更新时间:2023-12-03 21:24:41 25 4
gpt4 key购买 nike

我需要在我的语言扩展中嵌入标准语言(例如 JavaScript )。这意味着我想看到自动完成、语法高亮等,如 file.js .我可以这样做吗(如何)?

感谢您提供任何示例!

最佳答案

您可以继续 abc-lang示例在 Embedded Languages附加语法指南 syntaxes/abc.tmLanguage.json :

{
"scopeName": "source.abc",
"patterns": [ { "include": "#expression" } ],
"repository": {
"expression": {
"patterns": [
{ "include": "#letter" },
{ "include": "#paren-expression" },
{ "include": "#code" }
]
},
"letter": {
"match": "a|b|c",
"name": "keyword.letter"
},
"paren-expression": {
"begin": "\\(",
"end": "\\)",
"beginCaptures": {
"0": { "name": "punctuation.paren.open" }
},
"endCaptures": {
"0": { "name": "punctuation.paren.close" }
},
"name": "expression.group",
"patterns": [ { "include": "#expression" } ]
},
"code": {
"begin": "```js",
"end": "```",
"beginCaptures": {
"0": { "name": "punctuation.code.open" }
},
"endCaptures": {
"0": { "name": "punctuation.code.close" }
},
"name": "meta.embedded.block.javascript",
"patterns": [ { "include": "source.js" } ]
}
}
}

Matt 评论的固定链接是 https://github.com/microsoft/vscode/blob/5712574281bb096a2dd4ceda7e266d507f775b45/extensions/html/syntaxes/html.tmLanguage.json#L1936

关于visual-studio-code - VSCode 扩展 : embed standard language in mine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48984683/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com