feat(editor): highlight the apis block

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-20 12:31:19 +05:30
co-authored by Claude Opus 5
parent 7a1b4e5b33
commit 990a8128a7
2 changed files with 173 additions and 15 deletions
+37 -15
View File
@@ -113,10 +113,10 @@
"include": "#action-block"
},
{
"include": "#mode-block"
"include": "#api-block"
},
{
"include": "#api-block"
"include": "#apis-block"
},
{
"include": "#functions-block"
@@ -513,8 +513,8 @@
}
]
},
"mode-block": {
"begin": "\\b(ssr|client)\\b\\s*(\\{)",
"apis-block": {
"begin": "\\b(apis)\\b\\s*(\\{)",
"beginCaptures": {
"1": {
"name": "keyword.control.wrn"
@@ -534,21 +534,18 @@
"include": "#comments"
},
{
"begin": "\\b(api)\\b\\s+([A-Za-z_$][A-Za-z0-9_$]*)\\s+(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\\b\\s*([^\\s{]*)\\s*(\\{)",
"begin": "\\b([A-Za-z_$][A-Za-z0-9_$]*)\\s+(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\\b\\s*([^\\s{]*)\\s*(\\{)",
"beginCaptures": {
"1": {
"name": "keyword.control.wrn"
},
"2": {
"name": "entity.name.function.wrn"
},
"3": {
"2": {
"name": "constant.language.http-method.wrn"
},
"4": {
"3": {
"name": "string.unquoted.route.wrn"
},
"5": {
"4": {
"name": "punctuation.definition.block.begin.wrn"
}
},
@@ -558,8 +555,36 @@
"name": "punctuation.definition.block.end.wrn"
}
},
"contentName": "meta.embedded.block.ts",
"patterns": [
{
"include": "#comments"
},
{
"begin": "\\b(request|response|error)\\b\\s*(\\{)",
"beginCaptures": {
"1": {
"name": "keyword.control.wrn"
},
"2": {
"name": "punctuation.definition.block.begin.wrn"
}
},
"end": "\\}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.wrn"
}
},
"contentName": "meta.embedded.block.ts",
"patterns": [
{
"include": "#ts-braces"
},
{
"include": "source.ts"
}
]
},
{
"include": "#ts-braces"
},
@@ -567,9 +592,6 @@
"include": "source.ts"
}
]
},
{
"include": "#functions-block"
}
]
},