mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 03:56:03 +00:00
Update Lua Grammar (#142107)
This commit is contained in:
parent
4d43287a81
commit
e3a0fceb00
|
@ -4,13 +4,13 @@
|
|||
"component": {
|
||||
"type": "git",
|
||||
"git": {
|
||||
"name": "textmate/lua.tmbundle",
|
||||
"repositoryUrl": "https://github.com/textmate/lua.tmbundle",
|
||||
"commitHash": "8ae5641365b28f697121ba1133890e8d81f5b00e"
|
||||
"name": "sumneko/lua.tmbundle",
|
||||
"repositoryUrl": "https://github.com/sumneko/lua.tmbundle",
|
||||
"commitHash": "e531d0a651f1de222c6059d6e2edaca61b4dd4c4"
|
||||
}
|
||||
},
|
||||
"licenseDetail": [
|
||||
"Copyright (c) textmate-lua.tmbundle project authors",
|
||||
"Copyright (c) sumneko-lua.tmbundle project authors",
|
||||
"",
|
||||
"If not otherwise specified (see below), files in this repository fall under the following license:",
|
||||
"",
|
||||
|
@ -25,7 +25,7 @@
|
|||
"\"tidy\" is accompanied by \"tidy-license.txt\"."
|
||||
],
|
||||
"license": "TextMate Bundle License",
|
||||
"version": "0.0.0"
|
||||
"version": "1.0.0"
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"vscode": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/lua.tmbundle Syntaxes/Lua.plist ./syntaxes/lua.tmLanguage.json"
|
||||
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin sumneko/lua.tmbundle Syntaxes/Lua.plist ./syntaxes/lua.tmLanguage.json"
|
||||
},
|
||||
"contributes": {
|
||||
"languages": [
|
||||
|
|
|
@ -1,146 +1,99 @@
|
|||
{
|
||||
"information_for_contributors": [
|
||||
"This file has been converted from https://github.com/textmate/lua.tmbundle/blob/master/Syntaxes/Lua.plist",
|
||||
"This file has been converted from https://github.com/sumneko/lua.tmbundle/blob/master/Syntaxes/Lua.plist",
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/textmate/lua.tmbundle/commit/8ae5641365b28f697121ba1133890e8d81f5b00e",
|
||||
"version": "https://github.com/sumneko/lua.tmbundle/commit/e531d0a651f1de222c6059d6e2edaca61b4dd4c4",
|
||||
"name": "Lua",
|
||||
"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"
|
||||
"name": "keyword.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"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.parameters.end.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?<=[\\)\\-{}\\[\\]\"'])",
|
||||
"name": "meta.function.lua",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "[a-zA-Z_][a-zA-Z0-9_]*",
|
||||
"name": "variable.parameter.function.lua"
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"match": ",",
|
||||
"name": "punctuation.separator.arguments.lua"
|
||||
"begin": "(\\()",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.parameters.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "(\\))|(?=[\\-\\.{}\\[\\]\"'])",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.parameters.finish.lua"
|
||||
}
|
||||
},
|
||||
"name": "meta.parameter.lua",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"match": "[a-zA-Z_][a-zA-Z0-9_]*",
|
||||
"name": "variable.parameter.function.lua"
|
||||
},
|
||||
{
|
||||
"match": ",",
|
||||
"name": "punctuation.separator.arguments.lua"
|
||||
},
|
||||
{
|
||||
"begin": ":",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.separator.arguments.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=[\\),])",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#luadoc.type"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b\\s*(?=:)",
|
||||
"name": "entity.name.class.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
|
||||
"name": "entity.name.function.lua"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(?![pPeE.0-9])",
|
||||
"name": "constant.numeric.integer.hexadecimal.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(\\.[0-9A-Fa-f]+)?([eE]-?\\d*)?([pP][-+]\\d+)?",
|
||||
"name": "constant.numeric.float.hexadecimal.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![\\w\\d.])\\d+(?![pPeE.0-9])",
|
||||
"name": "constant.numeric.integer.lua"
|
||||
"match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(?![pPeE.0-9])",
|
||||
"name": "constant.numeric.integer.hexadecimal.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![\\w\\d.])\\d+(\\.\\d+)?([eE]-?\\d*)?",
|
||||
"name": "constant.numeric.float.lua"
|
||||
},
|
||||
{
|
||||
"begin": "'",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "'",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.single.lua",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#escaped_char"
|
||||
}
|
||||
]
|
||||
"match": "(?<![\\w\\d.])\\d+(?![pPeE.0-9])",
|
||||
"name": "constant.numeric.integer.lua"
|
||||
},
|
||||
{
|
||||
"begin": "\"",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\"",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.double.lua",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#escaped_char"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=\\.cdef)\\s*(\\[(=*)\\[)",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "string.quoted.other.multiline.lua"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"contentName": "meta.embedded.lua",
|
||||
"end": "(\\]\\2\\])",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "string.quoted.other.multiline.lua"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.c"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<!--)\\[(=*)\\[",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\]\\1\\]",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.other.multiline.lua"
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
|
@ -152,45 +105,7 @@
|
|||
"name": "comment.line.shebang.lua"
|
||||
},
|
||||
{
|
||||
"begin": "(^[ \\t]+)?(?=--)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.leading.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?!\\G)((?!^)[ \\t]+\\n)?",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.trailing.lua"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "--\\[(=*)\\[",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\]\\1\\]",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "comment.block.lua"
|
||||
},
|
||||
{
|
||||
"begin": "--",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\n",
|
||||
"name": "comment.line.double-dash.lua"
|
||||
}
|
||||
]
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
|
@ -198,7 +113,7 @@
|
|||
"name": "keyword.control.goto.lua"
|
||||
},
|
||||
"2": {
|
||||
"name": "constant.other.placeholder.lua"
|
||||
"name": "string.tag.lua"
|
||||
}
|
||||
},
|
||||
"match": "\\b(goto)\\s+([a-zA-Z_][a-zA-Z0-9_]*)"
|
||||
|
@ -206,21 +121,41 @@
|
|||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.label.begin.lua"
|
||||
"name": "punctuation.section.embedded.begin.lua"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.label.end.lua"
|
||||
"name": "punctuation.section.embedded.end.lua"
|
||||
}
|
||||
},
|
||||
"match": "(::)[a-zA-Z_][a-zA-Z0-9_]*(::)",
|
||||
"name": "constant.other.placeholder.lua"
|
||||
"match": "(::)\\s*[a-zA-Z_][a-zA-Z0-9_]*\\s*(::)",
|
||||
"name": "string.tag.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|function|local|in)\\b",
|
||||
"match": "<\\s*(const|close)\\s*>",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "string.tag.lua"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "\\<[a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*\\>",
|
||||
"name": "storage.type.generic.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|in)\\b",
|
||||
"name": "keyword.control.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![^.]\\.|:)\\b(false|nil|true|_G|_VERSION|math\\.(pi|huge))\\b|(?<![.])\\.{3}(?!\\.)",
|
||||
"match": "\\b(local|global)\\b",
|
||||
"name": "keyword.local.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\b(function)\\b(?![,:])",
|
||||
"name": "keyword.control.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![^.]\\.|:)\\b(false|nil(?!:)|true|_ENV|_G|_VERSION|math\\.(pi|huge|maxinteger|mininteger)|utf8\\.charpattern|io\\.(stdin|stdout|stderr)|package\\.(config|cpath|loaded|loaders|path|preload|searchers))\\b|(?<![.])\\.{3}(?!\\.)",
|
||||
"name": "constant.language.lua"
|
||||
},
|
||||
{
|
||||
|
@ -228,27 +163,39 @@
|
|||
"name": "variable.language.self.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![^.]\\.|:)\\b(assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\b(?=\\s*(?:[({\"']|\\[\\[))",
|
||||
"match": "(?<![^.]\\.|:)\\b(assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\b(?!\\s*=(?!=))",
|
||||
"name": "support.function.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![^.]\\.|:)\\b(coroutine\\.(create|resume|running|status|wrap|yield)|string\\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\\.(concat|insert|maxn|remove|sort)|math\\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?)|io\\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\\.(cpath|loaded|loadlib|path|preload|seeall)|debug\\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|traceback))\\b(?=\\s*(?:[({\"']|\\[\\[))",
|
||||
"match": "(?<![^.]\\.|:)\\b(async)\\b(?!\\s*=(?!=))",
|
||||
"name": "entity.name.tag.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![^.]\\.|:)\\b(unknown|any|boolean|number|integer|thread|table|string|userdata|lightuserdata|function|method)\\b(?!\\s*=(?!=))",
|
||||
"name": "support.type.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<![^.]\\.|:)\\b(coroutine\\.(create|isyieldable|close|resume|running|status|wrap|yield)|string\\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)|table\\.(concat|insert|maxn|move|pack|remove|sort|unpack)|math\\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?|tointeger|type)|io\\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\\.(loadlib|seeall|searchpath)|debug\\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|[gs]etuservalue|set[Cc]stacklimit|traceback|upvalueid|upvaluejoin)|bit32\\.(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)|utf8\\.(char|codes|codepoint|len|offset))\\b(?!\\s*=(?!=))",
|
||||
"name": "support.function.library.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\b(and|or|not)\\b",
|
||||
"match": "\\b(and|or|not|\\|\\||\\&\\&|\\!)\\b",
|
||||
"name": "keyword.operator.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*(?:[({\"']|\\[\\[))",
|
||||
"name": "support.function.any-method.lua"
|
||||
"name": "entity.name.function.lua"
|
||||
},
|
||||
{
|
||||
"match": "(?<=[^.]\\.|:)\\b([a-zA-Z_][a-zA-Z0-9_]*)",
|
||||
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*\\??:)",
|
||||
"name": "support.type.property-name.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
|
||||
"name": "variable.other.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\+|-|%|#|\\*|\\/|\\^|==?|~=|<=?|>=?|(?<!\\.)\\.{2}(?!\\.)",
|
||||
"match": "\\+|-|%|#|\\*|\\/|\\^|==?|~=|!=|<=?|>=?|(?<!\\.)\\.{2}(?!\\.)",
|
||||
"name": "keyword.operator.lua"
|
||||
}
|
||||
],
|
||||
|
@ -256,7 +203,11 @@
|
|||
"escaped_char": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\\\[abfnrtvz\\\\\"'\\n]",
|
||||
"match": "\\\\[abfnrtv\\\\\"'\\n]",
|
||||
"name": "constant.character.escape.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\\\z[\\n\\t ]*",
|
||||
"name": "constant.character.escape.lua"
|
||||
},
|
||||
{
|
||||
|
@ -276,6 +227,575 @@
|
|||
"name": "invalid.illegal.character.escape.lua"
|
||||
}
|
||||
]
|
||||
},
|
||||
"string": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "'",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "'[ \\t]*|(?=\\n)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.single.lua",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#escaped_char"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\"",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\"[ \\t]*|(?=\\n)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.double.lua",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#escaped_char"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "`",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "`[ \\t]*|(?=\\n)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.double.lua"
|
||||
},
|
||||
{
|
||||
"begin": "(?<=\\.cdef)\\s*(\\[(=*)\\[)",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "string.quoted.other.multiline.lua"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"contentName": "meta.embedded.lua",
|
||||
"end": "(\\]\\2\\])[ \\t]*",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "string.quoted.other.multiline.lua"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.c"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<!--)\\[(=*)\\[",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\]\\1\\][ \\t]*",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.other.multiline.lua"
|
||||
}
|
||||
]
|
||||
},
|
||||
"comment": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(^[ \\t]+)?(?=--)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.leading.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?!\\G)((?!^)[ \\t]+\\n)?",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.trailing.lua"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "--\\[(=*)\\[",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\]\\1\\]",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "comment.block.lua"
|
||||
},
|
||||
{
|
||||
"begin": "----",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\n",
|
||||
"name": "comment.line.double-dash.lua"
|
||||
},
|
||||
{
|
||||
"begin": "---",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\n",
|
||||
"name": "comment.line.double-dash.doc.lua",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#luadoc"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "--",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\n",
|
||||
"name": "comment.line.double-dash.lua"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\/\\*",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.begin.lua"
|
||||
}
|
||||
},
|
||||
"end": "\\*\\/",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.end.lua"
|
||||
}
|
||||
},
|
||||
"name": "comment.block.lua"
|
||||
}
|
||||
]
|
||||
},
|
||||
"luadoc": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(?<=---\\s*)@class",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
|
||||
"name": "support.class.lua"
|
||||
},
|
||||
{
|
||||
"match": ":|,",
|
||||
"name": "keyword.operator.lua"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@type",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#luadoc.type"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@alias",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "variable.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#luadoc.type"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@param",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(\\??)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "entity.name.variable.lua"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.operator.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#luadoc.type"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@return",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\?",
|
||||
"name": "keyword.operator.lua"
|
||||
},
|
||||
{
|
||||
"include": "#luadoc.type"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@field",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b|(\\[))(\\??)",
|
||||
"beginCaptures": {
|
||||
"2": {
|
||||
"name": "entity.name.variable.lua"
|
||||
},
|
||||
"3": {
|
||||
"name": "keyword.operator.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#luadoc.type"
|
||||
},
|
||||
{
|
||||
"match": "\\]",
|
||||
"name": "keyword.operator.lua"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@generic",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.generic.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)|(,)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.lua"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"match": ":",
|
||||
"name": "keyword.operator.lua"
|
||||
},
|
||||
{
|
||||
"include": "#luadoc.type"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@vararg",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#luadoc.type"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@overload",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#luadoc.type"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@deprecated",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)"
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@meta",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)"
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@version",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\b(5\\.1|5\\.2|5\\.3|5\\.4|JIT)\\b",
|
||||
"name": "support.class.lua"
|
||||
},
|
||||
{
|
||||
"match": ",|\\>|\\<",
|
||||
"name": "keyword.operator.lua"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@see",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
|
||||
"name": "support.class.lua"
|
||||
},
|
||||
{
|
||||
"match": "#",
|
||||
"name": "keyword.operator.lua"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@diagnostic",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "([a-zA-Z_\\-0-9]+)[ \\t]*(:)?",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.unit"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.operator.unit"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\-]*)",
|
||||
"name": "support.class.lua"
|
||||
},
|
||||
{
|
||||
"match": ",",
|
||||
"name": "keyword.operator.lua"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---\\s*)@module",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": "(?<=---\\s*)@(async|nodiscard)",
|
||||
"name": "storage.type.annotation.lua"
|
||||
},
|
||||
{
|
||||
"begin": "(?<=---)\\|\\s*[\\>\\+]?",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "storage.type.annotation.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=[\\n#])",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"luadoc.type": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\bfun\\b",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.control.lua"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\s)",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "[\\(\\),:\\?][ \\t]*",
|
||||
"name": "keyword.operator.lua"
|
||||
},
|
||||
{
|
||||
"match": "([a-zA-Z_][a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]*)(?<!,)[ \\t]*(?=\\??:)",
|
||||
"name": "entity.name.variable.lua"
|
||||
},
|
||||
{
|
||||
"include": "#luadoc.type"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": "\\<[a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*\\>",
|
||||
"name": "storage.type.generic.lua"
|
||||
},
|
||||
{
|
||||
"match": "\\basync\\b",
|
||||
"name": "entity.name.tag.lua"
|
||||
},
|
||||
{
|
||||
"match": "[\\{\\}\\:\\,\\?\\|\\`][ \\t]*",
|
||||
"name": "keyword.operator.lua"
|
||||
},
|
||||
{
|
||||
"begin": "(?=[a-zA-Z_\\.\\*\"'\\[])",
|
||||
"end": "(?=[\\s\\)\\,\\?\\:\\}\\|])",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "([a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]+)(?<!,)[ \\t]*",
|
||||
"name": "support.type.lua"
|
||||
},
|
||||
{
|
||||
"match": "(\\.\\.\\.)[ \\t]*",
|
||||
"name": "constant.language.lua"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -89,7 +89,7 @@
|
|||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.lua meta.function.lua punctuation.definition.parameters.begin.lua",
|
||||
"t": "source.lua meta.function.lua meta.parameter.lua punctuation.definition.parameters.begin.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
|
@ -100,7 +100,7 @@
|
|||
},
|
||||
{
|
||||
"c": "n",
|
||||
"t": "source.lua meta.function.lua variable.parameter.function.lua",
|
||||
"t": "source.lua meta.function.lua meta.parameter.lua variable.parameter.function.lua",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
|
@ -111,7 +111,7 @@
|
|||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.lua meta.function.lua punctuation.definition.parameters.end.lua",
|
||||
"t": "source.lua meta.function.lua meta.parameter.lua punctuation.definition.parameters.finish.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
|
@ -143,7 +143,29 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"c": " n ",
|
||||
"c": " ",
|
||||
"t": "source.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "n",
|
||||
"t": "source.lua variable.other.lua",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
|
@ -177,7 +199,7 @@
|
|||
},
|
||||
{
|
||||
"c": "0",
|
||||
"t": "source.lua constant.numeric.integer.lua",
|
||||
"t": "source.lua constant.numeric.float.lua",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #098658",
|
||||
|
@ -243,7 +265,7 @@
|
|||
},
|
||||
{
|
||||
"c": "1",
|
||||
"t": "source.lua constant.numeric.integer.lua",
|
||||
"t": "source.lua constant.numeric.float.lua",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #098658",
|
||||
|
@ -297,7 +319,29 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"c": " n ",
|
||||
"c": " ",
|
||||
"t": "source.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "n",
|
||||
"t": "source.lua variable.other.lua",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
|
@ -331,17 +375,17 @@
|
|||
},
|
||||
{
|
||||
"c": "fact",
|
||||
"t": "source.lua support.function.any-method.lua",
|
||||
"t": "source.lua entity.name.function.lua",
|
||||
"r": {
|
||||
"dark_plus": "support.function: #DCDCAA",
|
||||
"light_plus": "support.function: #795E26",
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.function: #DCDCAA"
|
||||
"hc_black": "entity.name.function: #DCDCAA"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "(n",
|
||||
"c": "(",
|
||||
"t": "source.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
|
@ -351,6 +395,17 @@
|
|||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "n",
|
||||
"t": "source.lua variable.other.lua",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "-",
|
||||
"t": "source.lua keyword.operator.lua",
|
||||
|
@ -364,7 +419,7 @@
|
|||
},
|
||||
{
|
||||
"c": "1",
|
||||
"t": "source.lua constant.numeric.integer.lua",
|
||||
"t": "source.lua constant.numeric.float.lua",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #098658",
|
||||
|
@ -506,7 +561,29 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"c": " a ",
|
||||
"c": " ",
|
||||
"t": "source.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "a",
|
||||
"t": "source.lua variable.other.lua",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
|
@ -661,17 +738,39 @@
|
|||
},
|
||||
{
|
||||
"c": "fact",
|
||||
"t": "source.lua support.function.any-method.lua",
|
||||
"t": "source.lua entity.name.function.lua",
|
||||
"r": {
|
||||
"dark_plus": "support.function: #DCDCAA",
|
||||
"light_plus": "support.function: #795E26",
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.function: #DCDCAA"
|
||||
"hc_black": "entity.name.function: #DCDCAA"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "(a))",
|
||||
"c": "(",
|
||||
"t": "source.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "a",
|
||||
"t": "source.lua variable.other.lua",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "))",
|
||||
"t": "source.lua",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
|
@ -681,4 +780,4 @@
|
|||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
Loading…
Reference in a new issue