diff --git a/extensions/lua/cgmanifest.json b/extensions/lua/cgmanifest.json index 6cefc1ca59e..2318a09b737 100644 --- a/extensions/lua/cgmanifest.json +++ b/extensions/lua/cgmanifest.json @@ -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 diff --git a/extensions/lua/package.json b/extensions/lua/package.json index 8161da9f705..43e18471bac 100644 --- a/extensions/lua/package.json +++ b/extensions/lua/package.json @@ -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": [ diff --git a/extensions/lua/syntaxes/lua.tmLanguage.json b/extensions/lua/syntaxes/lua.tmLanguage.json index c2b31570531..4ef52fccff2 100644 --- a/extensions/lua/syntaxes/lua.tmLanguage.json +++ b/extensions/lua/syntaxes/lua.tmLanguage.json @@ -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": "(?", + "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": "(?=?|(?=?|(?|\\<", + "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_\\.\\*\\[\\]\\<\\>\\,\\-]*)(?", + "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_\\.\\*\\[\\]\\<\\>\\,\\-]+)(?