我尝试为客户语言编写vscode语法文件
我使用photoshop绘制自定义语言的示例语法。
如何编写tmLanguage的语法?
{
"begin": "\\{\\{",
"beginCaptures": {
"0": {
"name": "punctuation.definition.brace.curly.start"
}
},
"end": "\\}\\}",
"endCaptures": {
"0": {
"name": "punctuation.definition.brace.curly.end"
}
},
"patterns": [
{
"include": "source.js#expression"
}
]
}
将它用于子字符串实体模式但环绕字符串不匹配
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.wxml"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.wxml"
}
},
"name": "string.quoted.double <===============********||||",
"patterns": [
{
"include": " the up pattern ↑"
}
]
}
如果name
存在,则所有双引号内容都是字符串的颜色
否则环绕声字符串是纯文本颜色。