Files
aster/vscode-ext/syntaxes/aster.tmLanguage.json
0264408 af63957b11 fix: LSP补全触发和语法高亮更新
- completion_provider 注册 a-z A-Z _ . 为触发字符,解决 Copilot 拦截补全问题
- 语法高亮新增 try catch finally throw 关键字

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-26 15:13:51 +08:00

157 lines
5.0 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Aster",
"scopeName": "source.aster",
"fileTypes": ["ast"],
"patterns": [
{ "include": "#comments" },
{ "include": "#strings" },
{ "include": "#numbers" },
{ "include": "#function-declaration" },
{ "include": "#keywords" },
{ "include": "#constants" },
{ "include": "#builtins" },
{ "include": "#operators" },
{ "include": "#punctuation" },
{ "include": "#identifiers" }
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.block.aster",
"begin": "/\\*",
"end": "\\*/",
"patterns": [
{
"name": "comment.block.aster",
"match": "."
}
]
},
{
"name": "comment.line.double-slash.aster",
"match": "//.*$"
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double.aster",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.aster",
"match": "\\\\[ntr\"\\\\]"
}
]
},
{
"name": "string.quoted.single.aster",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.aster",
"match": "\\\\[ntr'\\\\]"
}
]
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.float.aster",
"match": "\\b\\d+\\.\\d+\\b"
},
{
"name": "constant.numeric.integer.aster",
"match": "\\b\\d+\\b"
}
]
},
"function-declaration": {
"match": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
"captures": {
"1": { "name": "keyword.control.aster" },
"2": { "name": "entity.name.function.aster" }
}
},
"keywords": {
"patterns": [
{
"name": "keyword.control.aster",
"match": "\\b(let|const|fn|if|else|while|for|in|break|continue|return|try|catch|finally|throw)\\b"
}
]
},
"constants": {
"match": "\\b(true|false|nil)\\b",
"name": "constant.language.aster"
},
"builtins": {
"match": "\\b(print|input|clock|len|typeof|push|pop|split|trim|substring|replace|contains|upper|lower|starts_with|ends_with|require)\\b",
"name": "support.function.builtin.aster"
},
"operators": {
"patterns": [
{
"name": "keyword.operator.assignment.compound.aster",
"match": "\\+=|-=|\\*=|/=|%="
},
{
"name": "keyword.operator.logical.aster",
"match": "&&|\\|\\||!"
},
{
"name": "keyword.operator.comparison.aster",
"match": "==|!=|<=|>="
},
{
"name": "keyword.operator.assignment.aster",
"match": "="
},
{
"name": "keyword.operator.arithmetic.aster",
"match": "[+\\-*/%]"
},
{
"name": "keyword.operator.comparison.aster",
"match": "<|>"
}
]
},
"punctuation": {
"patterns": [
{
"name": "punctuation.section.scope.aster",
"match": "[{}]"
},
{
"name": "punctuation.section.brackets.aster",
"match": "[\\[\\]]"
},
{
"name": "punctuation.section.parens.aster",
"match": "[\\(\\)]"
},
{
"name": "punctuation.separator.aster",
"match": "[,;:\\.]"
},
{
"name": "keyword.operator.ternary.question.aster",
"match": "\\?"
}
]
},
"identifiers": {
"match": "[a-zA-Z_][a-zA-Z0-9_]*",
"name": "variable.other.aster"
}
}
}