diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-30 15:51:11 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-30 15:51:11 +0800 |
commit | f315a2b1f44a03ff864503dae48c4413d9954cc7 (patch) | |
tree | 07a02b613467ce97437df35ce3115c05384a80ef /syntaxes/lua.tmLanguage.json | |
parent | ef7e0c3604dcafee8cf46bd41d7c580ec06f5162 (diff) | |
download | lua-language-server-f315a2b1f44a03ff864503dae48c4413d9954cc7.zip |
更新语法着色
Diffstat (limited to 'syntaxes/lua.tmLanguage.json')
-rw-r--r-- | syntaxes/lua.tmLanguage.json | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/syntaxes/lua.tmLanguage.json b/syntaxes/lua.tmLanguage.json index a8d9eabf..7f5c7024 100644 --- a/syntaxes/lua.tmLanguage.json +++ b/syntaxes/lua.tmLanguage.json @@ -3,39 +3,33 @@ "scopeName": "source.lua", "patterns": [ { - "begin": "\\b(?:(local)\\s+)?(function)\\s*(?:\\s+([a-zA-Z_][a-zA-Z0-9_]*(?:([\\.:])[a-zA-Z_][a-zA-Z0-9_]*)?)\\s*)?(\\()", + "begin": "\\b(?:(local)\\s+)?(function)\\b", "beginCaptures": { "1": { "name": "storage.modifier.local.lua" }, "2": { - "name": "keyword.control.lua" - }, - "3": { - "name": "entity.name.function.lua" - }, - "4": { - "name": "punctuation.separator.parameter.lua" - }, - "5": { - "name": "punctuation.definition.parameters.begin.lua" + "name": "storage.modifier.function.lua" } }, - "end": "\\)", + "end": "(?=(\\()(?:[^\\)]*)(\\)))", "endCaptures": { - "0": { - "name": "punctuation.definition.parameters.end.lua" + "1": { + "name": "punctuation.definition.parameters.begin.lua" + }, + "2": { + "name": "punctuation.definition.parameters.finish.lua" } }, "name": "meta.function.lua", "patterns": [ { - "match": "[a-zA-Z_][a-zA-Z0-9_]*", - "name": "variable.parameter.function.lua" + "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*:)", + "name": "entity.name.class.lua" }, { - "match": ",", - "name": "punctuation.separator.arguments.lua" + "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b", + "name": "variable.other.lua" } ] }, @@ -210,10 +204,18 @@ "name": "string.tag.lua" }, { - "match": "\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|function|local(\\s*\\*toclose)?|in)\\b", + "match": "\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|in)\\b", "name": "keyword.control.lua" }, { + "match": "\\b(local(\\s*\\*toclose)?)\\b", + "name": "storage.modifier.local" + }, + { + "match": "\\b(function)\\b", + "name": "storage.modifier.function" + }, + { "match": "(?<![^.]\\.|:)\\b(false|nil|true|_G|_VERSION|math\\.(pi|huge)|utf8\\.charpattern|io\\.(stdin|stdout|stderr)|package\\.(cpath|loaded|path|preload|searchers))\\b|(?<![.])\\.{3}(?!\\.)", "name": "constant.language.lua" }, |