SPIRV-Tools/utils/vscode/spirv.json.tmpl
Ben Clayton 9e52bc0d0c
utils/vscode: LSP - Support OpExtInst (#3140)
This adds language server support for the `GLSL.std.450`, `OpenCL.std` and `OpenCL.DebugInfo.100` extension instructions.
2020-02-04 11:21:10 -05:00

73 lines
1.8 KiB
Cheetah

{
"scopeName": "source.spirv",
"name": "SPIR-V",
"comment": "Generated by {{GenerateArguments}}. Do not modify this file directly.",
"patterns": [
{{range $o := .All.OperandKinds}}{{if len $o.Enumerants}} { "include": "#{{$o.Category}}_{{$o.Kind}}" },
{{end}}{{end}} { "include": "#opcode" },
{ "include": "#extopcode" },
{ "include": "#identifier" },
{ "include": "#number" },
{ "include": "#string" },
{ "include": "#comment" },
{ "include": "#operator" }
],
"repository": { {{range $o := .All.OperandKinds}}{{if len $o.Enumerants}}
"{{$o.Category}}_{{$o.Kind}}": {
"match": "\\b({{OperandKindsMatch $o}})\\b",
"name": "keyword.spirv"
},{{end}}{{end}}
"opcode": {
"match": "(Op[a-zA-Z]+)",
"name": "entity.name.function.spirv"
},
"extopcode": {
"match": "({{AllExtOpcodes}})",
"name": "entity.name.function.ext"
},
"identifier": {
"match": "%[a-zA-Z0-9_]+",
"name": "variable.spirv"
},
"number": {
"match": "\\b[0-9]+.?[0-9]*\\b",
"name": "constant.numeric.spirv"
},
"comment": {
"match": ";[^\n]*",
"name": "comment.line.spirv"
},
"operator": {
"match": "=",
"name": "keyword.operator.spirv"
},
"string": {
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.spirv"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.spirv"
}
},
"name": "string.quoted.double.spirv",
"patterns": [ { "include": "#string_escaped_char" } ]
},
"string_escaped_char": {
"patterns": [
{
"match": "\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})",
"name": "constant.character.escape.spirv"
}, {
"match": "\\\\[^0-7xuUabfnrtv\\'\"]",
"name": "invalid.illegal.unknown-escape.spirv"
}
]
}
}
}