diff --git a/plugins/textmate/bundles.patch b/plugins/textmate/bundles.patch index 28aa011bf10f..0162b3655da8 100644 --- a/plugins/textmate/bundles.patch +++ b/plugins/textmate/bundles.patch @@ -76,8 +76,8 @@ diff --git a/community/plugins/textmate/lib/bundles/erlang/language-configuratio // Indent if a line ends brackets, "->" or most keywords. Also if prefixed // with "||". This should work with most formatting models. // The ((?!%).)* is to ensure this doesn't match inside comments. -- "increaseIndentPattern": "^((?!%).)*([{([]|->|after|begin|case|catch|fun|if|of|try|when|(\\|\\|.*))\\s*$", -+ "increaseIndentPattern": "^((?!%).)*([{(\\[]|->|after|begin|case|catch|fun|if|of|try|when|(\\|\\|.*))\\s*$", +- "increaseIndentPattern": "^((?!%).)*([{([]|->|after|begin|case|catch|fun|if|of|try|when|maybe|else|(\\|\\|.*))\\s*$", ++ "increaseIndentPattern": "^((?!%).)*([{(\\[]|->|after|begin|case|catch|fun|if|of|try|when|maybe|else|(\\|\\|.*))\\s*$", // Dedent after brackets, end or lone "->". The latter happens in a spec // with indented types, typically after "when". Only do this if it's _only_ // preceded by whitespace. diff --git a/plugins/textmate/lib/bundles/bat/cgmanifest.json b/plugins/textmate/lib/bundles/bat/cgmanifest.json deleted file mode 100644 index 7e0426c1387f..000000000000 --- a/plugins/textmate/lib/bundles/bat/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "mmims/language-batchfile", - "repositoryUrl": "https://github.com/mmims/language-batchfile", - "commitHash": "6154ae25a24e01ac9329e7bcf958e093cd8733a9" - } - }, - "license": "MIT", - "version": "0.7.6" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/clojure/cgmanifest.json b/plugins/textmate/lib/bundles/clojure/cgmanifest.json deleted file mode 100644 index c13821aba020..000000000000 --- a/plugins/textmate/lib/bundles/clojure/cgmanifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "atom/language-clojure", - "repositoryUrl": "https://github.com/atom/language-clojure", - "commitHash": "45bdb881501d0b8f8b707ca1d3fcc8b4b99fca03" - } - }, - "license": "MIT", - "version": "0.22.8", - "description": "The file syntaxes/clojure.tmLanguage.json was derived from the Atom package https://github.com/atom/language-clojure which was originally converted from the TextMate bundle https://github.com/mmcgrana/textmate-clojure." - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/coffeescript/cgmanifest.json b/plugins/textmate/lib/bundles/coffeescript/cgmanifest.json deleted file mode 100644 index 3c792173e6e7..000000000000 --- a/plugins/textmate/lib/bundles/coffeescript/cgmanifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "atom/language-coffee-script", - "repositoryUrl": "https://github.com/atom/language-coffee-script", - "commitHash": "0f6db9143663e18b1ad00667820f46747dba495e" - } - }, - "license": "MIT", - "description": "The file syntaxes/coffeescript.tmLanguage.json was derived from the Atom package https://github.com/atom/language-coffee-script which was originally converted from the TextMate bundle https://github.com/jashkenas/coffee-script-tmbundle.", - "version": "0.49.3" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/cpp/cgmanifest.json b/plugins/textmate/lib/bundles/cpp/cgmanifest.json deleted file mode 100644 index 89a893e2e5f3..000000000000 --- a/plugins/textmate/lib/bundles/cpp/cgmanifest.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "jeff-hykin/better-cpp-syntax", - "repositoryUrl": "https://github.com/jeff-hykin/better-cpp-syntax", - "commitHash": "f1d127a8af2b184db570345f0bb179503c47fdf6" - } - }, - "license": "MIT", - "licenseDetail": [ - [ - "MIT License", - "", - "Copyright (c) 2019 Jeff Hykin", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and associated documentation files (the \"Software\"), to deal", - "in the Software without restriction, including without limitation the rights", - "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", - "copies of the Software, and to permit persons to whom the Software is", - "furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in all", - "copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", - "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", - "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", - "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", - "SOFTWARE." - ] - ], - "version": "1.17.4", - "description": "The original JSON grammars were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." - }, - { - "component": { - "type": "git", - "git": { - "name": "jeff-hykin/better-c-syntax", - "repositoryUrl": "https://github.com/jeff-hykin/better-c-syntax", - "commitHash": "34712a6106a4ffb0a04d2fa836fd28ff6c5849a4" - } - }, - "license": "MIT", - "version": "1.13.2", - "description": "The original JSON grammars were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." - }, - { - "component": { - "type": "git", - "git": { - "name": "textmate/c.tmbundle", - "repositoryUrl": "https://github.com/textmate/c.tmbundle", - "commitHash": "60daf83b9d45329524f7847a75e9298b3aae5805" - } - }, - "licenseDetail": [ - "Copyright (c) textmate-c.tmbundle authors", - "", - "If not otherwise specified (see below), files in this repository fall under the following license:", - "", - "Permission to copy, use, modify, sell and distribute this", - "software is granted. This software is provided \"as is\" without", - "express or implied warranty, and with no claim as to its", - "suitability for any purpose.", - "", - "An exception is made for files in readable text which contain their own license information,", - "or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added", - "to the base-name name of the original file, and an extension of txt, html, or similar. For example", - "\"tidy\" is accompanied by \"tidy-license.txt\"." - ], - "license": "TextMate Bundle License", - "version": "0.0.0" - }, - { - "component": { - "type": "git", - "git": { - "name": "NVIDIA/cuda-cpp-grammar", - "repositoryUrl": "https://github.com/NVIDIA/cuda-cpp-grammar", - "commitHash": "81e88eaec5170aa8585736c63627c73e3589998c" - } - }, - "license": "MIT", - "version": "0.0.0", - "description": "The file syntaxes/cuda-cpp.tmLanguage.json was derived from https://github.com/jeff-hykin/cpp-textmate-grammar, which was derived from https://github.com/atom/language-c, which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/csharp/cgmanifest.json b/plugins/textmate/lib/bundles/csharp/cgmanifest.json deleted file mode 100644 index 176ee56da485..000000000000 --- a/plugins/textmate/lib/bundles/csharp/cgmanifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "dotnet/csharp-tmLanguage", - "repositoryUrl": "https://github.com/dotnet/csharp-tmLanguage", - "commitHash": "772323937fedd65c6dc1c8ce6ea41d97415ed7d1" - } - }, - "license": "MIT", - "version": "0.1.0", - "description": "The file syntaxes/csharp.tmLanguage.json was derived from https://github.com/dotnet/csharp-tmLanguage" - } - ], - "version": 1 -} diff --git a/plugins/textmate/lib/bundles/csharp/syntaxes/csharp.tmLanguage.json b/plugins/textmate/lib/bundles/csharp/syntaxes/csharp.tmLanguage.json index c4266da462d3..96dbe04473c3 100644 --- a/plugins/textmate/lib/bundles/csharp/syntaxes/csharp.tmLanguage.json +++ b/plugins/textmate/lib/bundles/csharp/syntaxes/csharp.tmLanguage.json @@ -4,7 +4,7 @@ "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/dotnet/csharp-tmLanguage/commit/772323937fedd65c6dc1c8ce6ea41d97415ed7d1", + "version": "https://github.com/dotnet/csharp-tmLanguage/commit/7a7482ffc72a6677a87eb1ed76005593a4f7f131", "name": "C#", "scopeName": "source.cs", "patterns": [ @@ -164,6 +164,9 @@ { "include": "#comment" }, + { + "include": "#storage-modifier" + }, { "include": "#property-declaration" }, @@ -176,6 +179,9 @@ { "include": "#method-declaration" }, + { + "include": "#operator-declaration" + }, { "include": "#attribute-section" }, @@ -210,9 +216,6 @@ { "include": "#else-part" }, - { - "include": "#switch-statement" - }, { "include": "#goto-statement" }, @@ -235,13 +238,13 @@ "include": "#try-statement" }, { - "include": "#checked-unchecked-statement" + "include": "#expression-operator-expression" }, { - "include": "#lock-statement" + "include": "#context-control-statement" }, { - "include": "#using-statement" + "include": "#context-control-paren-statement" }, { "include": "#labeled-statement" @@ -278,13 +281,10 @@ "include": "#comment" }, { - "include": "#checked-unchecked-expression" + "include": "#expression-operator-expression" }, { - "include": "#typeof-or-default-expression" - }, - { - "include": "#nameof-expression" + "include": "#type-operator-expression" }, { "include": "#default-literal-expression" @@ -305,14 +305,20 @@ "include": "#type-builtin" }, { - "include": "#this-or-base-expression" + "include": "#language-variable" }, { - "include": "#switch-expression" + "include": "#switch-statement-or-expression" + }, + { + "include": "#with-expression" }, { "include": "#conditional-operator" }, + { + "include": "#assignment-expression" + }, { "include": "#expression-operators" }, @@ -370,36 +376,39 @@ ] }, "extern-alias-directive": { - "begin": "\\s*(extern)\\b\\s*(alias)\\b\\s*(@?[_[:alpha:]][_[:alnum:]]*)", + "begin": "\\b(extern)\\s+(alias)\\b", "beginCaptures": { "1": { - "name": "keyword.other.extern.cs" + "name": "keyword.other.directive.extern.cs" }, "2": { - "name": "keyword.other.alias.cs" - }, - "3": { - "name": "variable.other.alias.cs" + "name": "keyword.other.directive.alias.cs" } }, - "end": "(?=;)" + "end": "(?=;)", + "patterns": [ + { + "match": "\\@?[_[:alpha:]][_[:alnum:]]*", + "name": "variable.other.alias.cs" + } + ] }, "using-directive": { "patterns": [ { - "begin": "(\\b(global)\\b\\s+)?\\b(using)\\b\\s+(static)\\b\\s+(\\b(unsafe)\\b\\s+)?", + "begin": "\\b(?:(global)\\s+)?(using)\\s+(static)\\b\\s*(?:(unsafe)\\b\\s*)?", "beginCaptures": { + "1": { + "name": "keyword.other.directive.global.cs" + }, "2": { - "name": "keyword.other.global.cs" + "name": "keyword.other.directive.using.cs" }, "3": { - "name": "keyword.other.using.cs" + "name": "keyword.other.directive.static.cs" }, "4": { - "name": "keyword.other.static.cs" - }, - "6": { - "name": "storage.modifier.cs" + "name": "storage.modifier.unsafe.cs" } }, "end": "(?=;)", @@ -410,19 +419,22 @@ ] }, { - "begin": "(\\b(global)\\b\\s+)?\\b(using)\\b\\s+(\\b(unsafe)\\b\\s+)?(?=(@?[_[:alpha:]][_[:alnum:]]*)\\s*=)", + "begin": "\\b(?:(global)\\s+)?(using)\\b\\s*(?:(unsafe)\\b\\s*)?(@?[_[:alpha:]][_[:alnum:]]*)\\s*(=)", "beginCaptures": { + "1": { + "name": "keyword.other.directive.global.cs" + }, "2": { - "name": "keyword.other.global.cs" + "name": "keyword.other.directive.using.cs" }, "3": { - "name": "keyword.other.using.cs" + "name": "storage.modifier.unsafe.cs" + }, + "4": { + "name": "entity.name.type.alias.cs" }, "5": { - "name": "storage.modifier.cs" - }, - "6": { - "name": "entity.name.type.alias.cs" + "name": "keyword.operator.assignment.cs" } }, "end": "(?=;)", @@ -432,20 +444,17 @@ }, { "include": "#type" - }, - { - "include": "#operator-assignment" } ] }, { - "begin": "(\\b(global)\\b\\s+)?\\b(using)\\s*(?!\\(|\\s|var)", + "begin": "\\b(?:(global)\\s+)?(using)\\b\\s*+(?!\\(|var\\b)", "beginCaptures": { - "2": { - "name": "keyword.other.global.cs" + "1": { + "name": "keyword.other.directive.global.cs" }, - "3": { - "name": "keyword.other.using.cs" + "2": { + "name": "keyword.other.directive.using.cs" } }, "end": "(?=;)", @@ -455,7 +464,10 @@ }, { "name": "entity.name.type.namespace.cs", - "match": "@?[_[:alpha:]][_[:alnum:]]*" + "match": "\\@?[_[:alpha:]][_[:alnum:]]*" + }, + { + "include": "#punctuation-accessor" }, { "include": "#operator-assignment" @@ -551,7 +563,7 @@ "begin": "\\b(namespace)\\s+", "beginCaptures": { "1": { - "name": "keyword.other.namespace.cs" + "name": "storage.type.namespace.cs" } }, "end": "(?<=\\})|(?=;)", @@ -594,7 +606,7 @@ ] }, "storage-modifier": { - "name": "storage.modifier.cs", + "name": "storage.modifier.$1.cs", "match": "(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s+\n(\\g)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", "beginCaptures": { "1": { - "name": "keyword.other.delegate.cs" + "name": "storage.type.delegate.cs" }, "2": { "patterns": [ @@ -712,7 +724,7 @@ "match": "(enum)\\s+(@?[_[:alpha:]][_[:alnum:]]*)", "captures": { "1": { - "name": "keyword.other.enum.cs" + "name": "storage.type.enum.cs" }, "2": { "name": "entity.name.type.enum.cs" @@ -796,7 +808,7 @@ "begin": "(?x)\n(interface)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)", "beginCaptures": { "1": { - "name": "keyword.other.interface.cs" + "name": "storage.type.interface.cs" }, "2": { "name": "entity.name.type.interface.cs" @@ -853,7 +865,7 @@ "begin": "(?x)\n(record)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)", "beginCaptures": { "1": { - "name": "keyword.other.record.cs" + "name": "storage.type.record.cs" }, "2": { "name": "entity.name.type.class.cs" @@ -913,10 +925,10 @@ "begin": "(?x)\n(\\b(record)\\b\\s+)?\n(struct)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)", "beginCaptures": { "2": { - "name": "keyword.other.record.cs" + "name": "storage.type.record.cs" }, "3": { - "name": "keyword.other.struct.cs" + "name": "storage.type.struct.cs" }, "4": { "name": "entity.name.type.struct.cs" @@ -984,19 +996,11 @@ "patterns": [ { "match": "\\b(in|out)\\b", - "captures": { - "1": { - "name": "storage.modifier.cs" - } - } + "name": "storage.modifier.$1.cs" }, { "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\b", - "captures": { - "1": { - "name": "entity.name.type.type-parameter.cs" - } - } + "name": "entity.name.type.type-parameter.cs" }, { "include": "#comment" @@ -1033,7 +1037,7 @@ "begin": "(where)\\s+(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)", "beginCaptures": { "1": { - "name": "keyword.other.where.cs" + "name": "storage.modifier.where.cs" }, "2": { "name": "entity.name.type.type-parameter.cs" @@ -1045,18 +1049,30 @@ "end": "(?=\\{|where|;|=>)", "patterns": [ { - "name": "keyword.other.class.cs", + "name": "storage.type.class.cs", "match": "\\bclass\\b" }, { - "name": "keyword.other.struct.cs", + "name": "storage.type.struct.cs", "match": "\\bstruct\\b" }, + { + "name": "keyword.other.constraint.default.cs", + "match": "\\bdefault\\b" + }, + { + "name": "keyword.other.constraint.notnull.cs", + "match": "\\bnotnull\\b" + }, + { + "name": "keyword.other.constraint.unmanaged.cs", + "match": "\\bunmanaged\\b" + }, { "match": "(new)\\s*(\\()\\s*(\\))", "captures": { "1": { - "name": "keyword.other.new.cs" + "name": "keyword.operator.expression.new.cs" }, "2": { "name": "punctuation.parenthesis.open.cs" @@ -1112,7 +1128,7 @@ ] }, "property-declaration": { - "begin": "(?x)\n\n# The negative lookahead below ensures that we don't match nested types\n# or other declarations as properties.\n(?![[:word:][:space:]]*\\b(?:class|interface|struct|enum|event)\\b)\n\n(?\n (?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?\\g)\\s*\n(?=\\{|=>|$)", + "begin": "(?x)\n\n# The negative lookahead below ensures that we don't match nested types\n# or other declarations as properties.\n(?![[:word:][:space:]]*\\b(?:class|interface|struct|enum|event)\\b)\n\n(?\n (?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?\\g)\\s*\n(?=\\{|=>|//|/\\*|$)", "beginCaptures": { "1": { "patterns": [ @@ -1144,7 +1160,7 @@ "include": "#property-accessors" }, { - "include": "#expression-body" + "include": "#accessor-getter-expression" }, { "include": "#variable-initializer" @@ -1175,7 +1191,7 @@ ] }, "8": { - "name": "keyword.other.this.cs" + "name": "variable.language.this.cs" } }, "end": "(?<=\\})|(?=;)", @@ -1190,7 +1206,7 @@ "include": "#property-accessors" }, { - "include": "#expression-body" + "include": "#accessor-getter-expression" }, { "include": "#variable-initializer" @@ -1198,10 +1214,10 @@ ] }, "event-declaration": { - "begin": "(?x)\n\\b(event)\\b\\s*\n(?\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?\\g(?:\\s*,\\s*\\g)*)\\s*\n(?=\\{|;|$)", + "begin": "(?x)\n\\b(event)\\b\\s*\n(?\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(\\g)\\s* # first event name\n(?=\\{|;|,|=|//|/\\*|$)", "beginCaptures": { "1": { - "name": "keyword.other.event.cs" + "name": "storage.type.event.cs" }, "2": { "patterns": [ @@ -1221,15 +1237,7 @@ ] }, "9": { - "patterns": [ - { - "name": "entity.name.variable.event.cs", - "match": "@?[_[:alpha:]][_[:alnum:]]*" - }, - { - "include": "#punctuation-comma" - } - ] + "name": "entity.name.variable.event.cs" } }, "end": "(?<=\\})|(?=;)", @@ -1240,8 +1248,29 @@ { "include": "#event-accessors" }, + { + "name": "entity.name.variable.event.cs", + "match": "@?[_[:alpha:]][_[:alnum:]]*" + }, { "include": "#punctuation-comma" + }, + { + "begin": "=", + "beginCaptures": { + "0": { + "name": "keyword.operator.assignment.cs" + } + }, + "end": "(?<=,)|(?=;)", + "patterns": [ + { + "include": "#expression" + }, + { + "include": "#punctuation-comma" + } + ] } ] }, @@ -1259,22 +1288,6 @@ } }, "patterns": [ - { - "name": "storage.modifier.cs", - "match": "\\b(private|protected|internal)\\b" - }, - { - "name": "keyword.other.get.cs", - "match": "\\b(get)\\b" - }, - { - "name": "keyword.other.set.cs", - "match": "\\b(set)\\b" - }, - { - "name": "keyword.other.init.cs", - "match": "\\b(init)\\b" - }, { "include": "#comment" }, @@ -1282,13 +1295,36 @@ "include": "#attribute-section" }, { - "include": "#expression-body" + "name": "storage.modifier.$1.cs", + "match": "\\b(private|protected|internal)\\b" }, { - "include": "#block" + "begin": "\\b(get)\\b\\s*(?=\\{|;|=>|//|/\\*|$)", + "beginCaptures": { + "1": { + "name": "storage.type.accessor.$1.cs" + } + }, + "end": "(?<=\\}|;)|(?=\\})", + "patterns": [ + { + "include": "#accessor-getter" + } + ] }, { - "include": "#punctuation-semicolon" + "begin": "\\b(set|init)\\b\\s*(?=\\{|;|=>|//|/\\*|$)", + "beginCaptures": { + "1": { + "name": "storage.type.accessor.$1.cs" + } + }, + "end": "(?<=\\}|;)|(?=\\})", + "patterns": [ + { + "include": "#accessor-setter" + } + ] } ] }, @@ -1306,14 +1342,6 @@ } }, "patterns": [ - { - "name": "keyword.other.add.cs", - "match": "\\b(add)\\b" - }, - { - "name": "keyword.other.remove.cs", - "match": "\\b(remove)\\b" - }, { "include": "#comment" }, @@ -1321,10 +1349,108 @@ "include": "#attribute-section" }, { - "include": "#expression-body" + "begin": "\\b(add|remove)\\b\\s*(?=\\{|;|=>|//|/\\*|$)", + "beginCaptures": { + "1": { + "name": "storage.type.accessor.$1.cs" + } + }, + "end": "(?<=\\}|;)|(?=\\})", + "patterns": [ + { + "include": "#accessor-setter" + } + ] + } + ] + }, + "accessor-getter": { + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.curlybrace.open.cs" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.curlybrace.close.cs" + } + }, + "contentName": "meta.accessor.getter.cs", + "patterns": [ + { + "include": "#statement" + } + ] }, { - "include": "#block" + "include": "#accessor-getter-expression" + }, + { + "include": "#punctuation-semicolon" + } + ] + }, + "accessor-getter-expression": { + "begin": "=>", + "beginCaptures": { + "0": { + "name": "keyword.operator.arrow.cs" + } + }, + "end": "(?=;|\\})", + "contentName": "meta.accessor.getter.cs", + "patterns": [ + { + "include": "#ref-modifier" + }, + { + "include": "#expression" + } + ] + }, + "accessor-setter": { + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.curlybrace.open.cs" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.curlybrace.close.cs" + } + }, + "contentName": "meta.accessor.setter.cs", + "patterns": [ + { + "include": "#statement" + } + ] + }, + { + "begin": "=>", + "beginCaptures": { + "0": { + "name": "keyword.operator.arrow.cs" + } + }, + "end": "(?=;|\\})", + "contentName": "meta.accessor.setter.cs", + "patterns": [ + { + "include": "#ref-modifier" + }, + { + "include": "#expression" + } + ] }, { "include": "#punctuation-semicolon" @@ -1425,13 +1551,10 @@ ] }, "constructor-initializer": { - "begin": "\\b(?:(base)|(this))\\b\\s*(?=\\()", + "begin": "\\b(base|this)\\b\\s*(?=\\()", "beginCaptures": { "1": { - "name": "keyword.other.base.cs" - }, - "2": { - "name": "keyword.other.this.cs" + "name": "variable.language.$1.cs" } }, "end": "(?<=\\))", @@ -1468,7 +1591,7 @@ ] }, "operator-declaration": { - "begin": "(?x)\n(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n(?(?:\\b(?:operator)))\\s*\n(?(?:\\+|-|\\*|/|%|&|\\||\\^|\\<\\<|\\>\\>|==|!=|\\>|\\<|\\>=|\\<=|!|~|\\+\\+|--|true|false))\\s*\n(?=\\()", + "begin": "(?x)\n(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n\\b(?operator)\\b\\s*\n(?[+\\-*/%&|\\^!=~<>]+|true|false)\\s*\n(?=\\()", "beginCaptures": { "1": { "patterns": [ @@ -1478,7 +1601,7 @@ ] }, "6": { - "name": "keyword.other.operator-decl.cs" + "name": "storage.type.operator.cs" }, "7": { "name": "entity.name.function.cs" @@ -1509,7 +1632,7 @@ "match": "\\b(explicit)\\b", "captures": { "1": { - "name": "keyword.other.explicit.cs" + "name": "storage.modifier.explicit.cs" } } }, @@ -1517,14 +1640,14 @@ "match": "\\b(implicit)\\b", "captures": { "1": { - "name": "keyword.other.implicit.cs" + "name": "storage.modifier.implicit.cs" } } } ] }, "2": { - "name": "keyword.other.operator-decl.cs" + "name": "storage.type.operator.cs" }, "3": { "patterns": [ @@ -1607,19 +1730,19 @@ "begin": "(?", + "beginCaptures": { + "0": { + "name": "keyword.operator.arrow.cs" + } + }, + "end": "(?=,|})", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "begin": "\\b(when)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.conditional.when.cs" + } + }, + "end": "(?==>|,|})", + "patterns": [ + { + "include": "#case-guard" + } + ] + }, + { + "begin": "(?!\\s)", + "end": "(?=\\bwhen\\b|=>|,|})", + "patterns": [ + { + "include": "#pattern" + } + ] + } + ] + }, + "case-guard": { + "patterns": [ + { + "include": "#parenthesized-expression" + }, + { + "include": "#expression" + } + ] + }, + "is-expression": { + "begin": "(?=?", + "beginCaptures": { + "0": { + "name": "keyword.operator.relational.cs" + } + }, + "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", + "patterns": [ + { + "include": "#expression" + } + ] + }, + "var-pattern": { + "begin": "\\b(var)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.var.cs" + } + }, + "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", + "patterns": [ + { + "include": "#designation-pattern" + } + ] + }, + "designation-pattern": { + "patterns": [ + { + "include": "#intrusive" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.parenthesis.open.cs" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.parenthesis.close.cs" + } + }, + "patterns": [ + { + "include": "#punctuation-comma" + }, + { + "include": "#designation-pattern" + } + ] + }, + { + "include": "#simple-designation-pattern" + } + ] + }, + "simple-designation-pattern": { + "patterns": [ + { + "include": "#discard-pattern" + }, + { + "match": "@?[_[:alpha:]][_[:alnum:]]*", + "name": "entity.name.variable.local.cs" + } + ] + }, + "type-pattern": { + "begin": "(?=@?[_[:alpha:]][_[:alnum:]]*)", + "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", + "patterns": [ + { + "begin": "\\G", + "end": "(?!\\G[@_[:alpha:]])(?=[\\({@_[:alpha:])}\\],;:=&|^]|(?:\\s|^)\\?|!=|\\b(and|or|when)\\b)", + "patterns": [ + { + "include": "#intrusive" + }, + { + "include": "#type-subpattern" + } + ] + }, + { + "begin": "(?=[\\({@_[:alpha:]])", + "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", + "patterns": [ + { + "include": "#intrusive" + }, + { + "include": "#positional-pattern" + }, + { + "include": "#property-pattern" + }, + { + "include": "#simple-designation-pattern" + } + ] + } + ] + }, + "type-subpattern": { + "patterns": [ + { + "include": "#type-builtin" + }, + { + "begin": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(::)", + "beginCaptures": { + "1": { + "name": "entity.name.type.alias.cs" + }, + "2": { + "name": "punctuation.separator.coloncolon.cs" + } + }, + "end": "(?<=[_[:alnum:]])|(?=[.<\\[\\({)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", + "patterns": [ + { + "include": "#intrusive" + }, + { + "match": "\\@?[_[:alpha:]][_[:alnum:]]*", + "name": "entity.name.type.cs" + } + ] + }, + { + "match": "\\@?[_[:alpha:]][_[:alnum:]]*", + "name": "entity.name.type.cs" + }, + { + "begin": "\\.", + "beginCaptures": { + "0": { + "name": "punctuation.accessor.cs" + } + }, + "end": "(?<=[_[:alnum:]])|(?=[<\\[\\({)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", + "patterns": [ + { + "include": "#intrusive" + }, + { + "match": "\\@?[_[:alpha:]][_[:alnum:]]*", + "name": "entity.name.type.cs" + } + ] + }, + { + "include": "#type-arguments" + }, + { + "include": "#type-array-suffix" + }, + { + "match": "(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s+\n(\\g)\\b\\s*", - "beginCaptures": { - "1": { + }, + { + "begin": "(?<=\\})", + "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", "patterns": [ { - "include": "#type" - } - ] - }, - "2": { - "name": "entity.name.variable.local.cs" - } - }, - "end": "(?==>)", - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#switch-when-clause" - } - ] - }, - "switch-property-expression": { - "begin": "(?x) # e.g. int x OR var x\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)?\\s*\n(\\{)", - "beginCaptures": { - "1": { - "patterns": [ + "include": "#intrusive" + }, { - "include": "#type" - } - ] - }, - "6": { - "name": "punctuation.curlybrace.open.cs" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.curlybrace.close.cs" - } - }, - "patterns": [ - { - "include": "#expression" - }, - { - "include": "#punctuation-comma" - } - ] - }, - "switch-var-pattern": { - "begin": "(?x) # match foreach (var (x, y) in ...)\n(?:\\b(var)\\b\\s*)\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s*", - "beginCaptures": { - "1": { - "name": "keyword.other.var.cs" - }, - "2": { - "patterns": [ - { - "include": "#tuple-declaration-deconstruction-element-list" + "include": "#simple-designation-pattern" } ] } - }, - "end": "(?==>)", - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#switch-when-clause" - } ] }, - "switch-when-clause": { - "begin": "(?)", + "subpattern": { "patterns": [ { - "include": "#comment" - }, - { - "include": "#expression" - }, - { - "include": "#punctuation-comma" - }, - { - "match": "\\(", - "captures": { - "0": { - "name": "punctuation.parenthesis.open.cs" - } - } - }, - { - "match": "\\)", - "captures": { - "0": { - "name": "punctuation.parenthesis.close.cs" - } - } - } - ] - }, - "switch-label": { - "patterns": [ - { - "begin": "(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\n)\\s+\n(\\g)\\s+\n\\b(in)\\b", + "include": "#intrusive" + }, + { + "match": "(?x)\n(?:\n (?:(\\bref)\\s+)?(\\bvar\\b)| # ref local\n (?\n (?:\n (?:ref\\s+)? # ref local\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\n)\\s+\n(\\g)\\s+\n\\b(in)\\b", "captures": { "1": { - "name": "keyword.other.var.cs" + "name": "storage.modifier.ref.cs" }, "2": { + "name": "storage.type.var.cs" + }, + "3": { "patterns": [ { "include": "#type" } ] }, - "7": { + "8": { "name": "entity.name.variable.local.cs" }, - "8": { + "9": { "name": "keyword.control.loop.in.cs" } } @@ -2176,7 +2740,7 @@ "match": "(?x) # match foreach (var (x, y) in ...)\n(?:\\b(var)\\b\\s*)?\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s+\n\\b(in)\\b", "captures": { "1": { - "name": "keyword.other.var.cs" + "name": "storage.type.var.cs" }, "2": { "patterns": [ @@ -2194,9 +2758,6 @@ "include": "#expression" } ] - }, - { - "include": "#statement" } ] }, @@ -2217,7 +2778,7 @@ "begin": "(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref local\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\n)\\s+\n(\\g)\\s*\n(?!=>)\n(?=,|;|=|\\))", + "begin": "(?x)\n(?:\n (?:(\\bref)\\s+(?:(\\breadonly)\\s+)?)?(\\bvar\\b)| # ref local\n (?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref local\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*[?*]\\s*)? # nullable or pointer suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\n)\\s+\n(\\g)\\s*\n(?!=>)\n(?=,|;|=|\\))", "beginCaptures": { "1": { - "name": "keyword.other.using.cs" + "name": "storage.modifier.ref.cs" }, "2": { - "name": "storage.modifier.cs" + "name": "storage.modifier.readonly.cs" }, "3": { - "name": "storage.modifier.cs" + "name": "storage.type.var.cs" }, "4": { - "name": "keyword.other.var.cs" - }, - "5": { "patterns": [ { "include": "#type" } ] }, - "10": { + "9": { "name": "entity.name.variable.local.cs" } }, - "end": "(?=;|\\))", + "end": "(?=[;)}])", "patterns": [ { "name": "entity.name.variable.local.cs", @@ -2486,7 +3089,7 @@ "begin": "(?x)\n(?\\b(?:const)\\b)\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s+\n(\\g)\\s*\n(?=,|;|=)", "beginCaptures": { "1": { - "name": "storage.modifier.cs" + "name": "storage.modifier.const.cs" }, "2": { "patterns": [ @@ -2517,9 +3120,49 @@ ] }, "local-function-declaration": { + "begin": "(?x)\n\\b((?:(?:async|unsafe|static|extern)\\s+)*)\n(?\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n \\s*(?:,\\s*)* # commata for multi-dimensional arrays\n \\]\n (?:\\s*\\?)? # arrays can be nullable reference types\n )*\n)\\s+\n(\\g)\\s*\n(<[^<>]+>)?\\s*\n(?=\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#storage-modifier" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "entity.name.function.cs" + }, + "8": { + "patterns": [ + { + "include": "#type-parameter-list" + } + ] + } + }, + "end": "(?<=\\})|(?=;)", "patterns": [ { - "include": "#method-declaration" + "include": "#comment" + }, + { + "include": "#parenthesized-parameter-list" + }, + { + "include": "#generic-constraints" + }, + { + "include": "#expression-body" + }, + { + "include": "#block" } ] }, @@ -2527,7 +3170,7 @@ "begin": "(?x) # e.g. var (x, y) = GetPoint();\n(?:\\b(var)\\b\\s*)\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?=;|=|\\))", "beginCaptures": { "1": { - "name": "keyword.other.var.cs" + "name": "storage.type.var.cs" }, "2": { "patterns": [ @@ -2635,7 +3278,7 @@ "match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\n)\\s+\n(\\g)\\b\\s*\n(?=[,)\\]])", "captures": { "1": { - "name": "keyword.other.var.cs" + "name": "storage.type.var.cs" }, "2": { "patterns": [ @@ -2653,7 +3296,7 @@ "match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\n)\\s+\n(\\g)\\b\\s*\n(?=[,)])", "captures": { "1": { - "name": "keyword.other.var.cs" + "name": "storage.type.var.cs" }, "2": { "patterns": [ @@ -2667,16 +3310,13 @@ } } }, - "checked-unchecked-expression": { - "begin": "(?>>?|\\|)?=(?!=|>)", + "beginCaptures": { + "0": { + "patterns": [ + { + "include": "#assignment-operators" + } + ] + } + }, + "end": "(?=[,\\)\\];}])", + "patterns": [ + { + "include": "#ref-modifier" + }, + { + "include": "#expression" + } + ] + }, + "assignment-operators": { "patterns": [ { "name": "keyword.operator.assignment.compound.cs", @@ -3391,11 +4027,19 @@ }, { "name": "keyword.operator.assignment.compound.bitwise.cs", - "match": "\\&=|\\^=|<<=|>>=|\\|=" + "match": "\\&=|\\^=|<<=|>>>?=|\\|=" }, + { + "name": "keyword.operator.assignment.cs", + "match": "\\=" + } + ] + }, + "expression-operators": { + "patterns": [ { "name": "keyword.operator.bitwise.shift.cs", - "match": "<<|>>" + "match": "<<|>>>?" }, { "name": "keyword.operator.comparison.cs", @@ -3413,10 +4057,6 @@ "name": "keyword.operator.bitwise.cs", "match": "\\&|~|\\^|\\|" }, - { - "name": "keyword.operator.assignment.cs", - "match": "\\=" - }, { "name": "keyword.operator.decrement.cs", "match": "--" @@ -3427,56 +4067,50 @@ }, { "name": "keyword.operator.arithmetic.cs", - "match": "%|\\*|/|-|\\+" + "match": "\\+|-(?!>)|\\*|/|%" }, { "name": "keyword.operator.null-coalescing.cs", "match": "\\?\\?" + }, + { + "name": "keyword.operator.range.cs", + "match": "\\.\\." } ] }, - "switch-literal": { - "name": "constant.language.null.cs", - "match": "(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)?", + "match": "(?x)\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?(?!\\?))? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n \\s*(?:,\\s*)* # commata for multi-dimensional arrays\n \\]\n (?:\\s*\\?(?!\\?))? # arrays can be nullable reference types\n )*\n )\n)?", "captures": { "1": { - "name": "keyword.other.as.cs" + "name": "keyword.operator.expression.as.cs" }, "2": { "patterns": [ @@ -3556,34 +4190,20 @@ } } }, - "is-expression": { - "match": "(?x)\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)?", - "captures": { - "1": { - "name": "keyword.other.is.cs" + "language-variable": { + "patterns": [ + { + "name": "variable.language.$1.cs", + "match": "\\b(base|this)\\b" }, - "2": { - "patterns": [ - { - "include": "#type" - } - ] + { + "name": "variable.other.$1.cs", + "match": "\\b(value)\\b" } - } - }, - "this-or-base-expression": { - "match": "\\b(?:(base)|(this))\\b", - "captures": { - "1": { - "name": "keyword.other.base.cs" - }, - "2": { - "name": "keyword.other.this.cs" - } - } + ] }, "invocation-expression": { - "begin": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(?:(\\.)\\s*)? # preceding dot?\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # method name\n(?\\s*<([^<>]|\\g)+>\\s*)?\\s* # type arguments\n(?=\\() # open paren of argument list", + "begin": "(?x)\n(?:\n (?:(\\?)\\s*)? # preceding null-conditional operator?\n (\\.)\\s*| # preceding dot?\n (->)\\s* # preceding pointer arrow?\n)?\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # method name\n(\n <\n (?\n [^<>()]++|\n <\\g*+>|\n \\(\\g*+\\)\n )*+\n >\\s*\n)? # type arguments\n(?=\\() # open paren of argument list", "beginCaptures": { "1": { "name": "keyword.operator.null-conditional.cs" @@ -3592,9 +4212,12 @@ "name": "punctuation.accessor.cs" }, "3": { - "name": "entity.name.function.cs" + "name": "punctuation.accessor.pointer.cs" }, "4": { + "name": "entity.name.function.cs" + }, + "5": { "patterns": [ { "include": "#type-arguments" @@ -3610,7 +4233,7 @@ ] }, "element-access-expression": { - "begin": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(?:(\\.)\\s*)? # preceding dot?\n(?:(@?[_[:alpha:]][_[:alnum:]]*)\\s*)? # property name\n(?:(\\?)\\s*)? # null-conditional operator?\n(?=\\[) # open bracket of argument list", + "begin": "(?x)\n(?:\n (?:(\\?)\\s*)? # preceding null-conditional operator?\n (\\.)\\s*| # preceding dot?\n (->)\\s* # preceding pointer arrow?\n)?\n(?:(@?[_[:alpha:]][_[:alnum:]]*)\\s*)? # property name\n(?:(\\?)\\s*)? # null-conditional operator?\n(?=\\[) # open bracket of argument list", "beginCaptures": { "1": { "name": "keyword.operator.null-conditional.cs" @@ -3619,9 +4242,12 @@ "name": "punctuation.accessor.cs" }, "3": { - "name": "variable.other.object.property.cs" + "name": "punctuation.accessor.pointer.cs" }, "4": { + "name": "variable.other.object.property.cs" + }, + "5": { "name": "keyword.operator.null-conditional.cs" } }, @@ -3635,7 +4261,7 @@ "member-access-expression": { "patterns": [ { - "match": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(\\.)\\s* # preceding dot\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # property name\n(?![_[:alnum:]]|\\(|(\\?)?\\[|<) # next character is not alpha-numeric, nor a (, [, or <. Also, test for ?[", + "match": "(?x)\n(?:\n (?:(\\?)\\s*)? # preceding null-conditional operator?\n (\\.)\\s*| # preceding dot?\n (->)\\s* # preceding pointer arrow?\n)\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # property name\n(?![_[:alnum:]]|\\(|(\\?)?\\[|<) # next character is not alpha-numeric, nor a (, [, or <. Also, test for ?[", "captures": { "1": { "name": "keyword.operator.null-conditional.cs" @@ -3644,6 +4270,9 @@ "name": "punctuation.accessor.cs" }, "3": { + "name": "punctuation.accessor.pointer.cs" + }, + "4": { "name": "variable.other.object.property.cs" } } @@ -3667,7 +4296,7 @@ } }, { - "match": "(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)", + "match": "(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?=\n \\s*(?:(?:\\?\\s*)?\\.|->)\n \\s*@?[_[:alpha:]][_[:alnum:]]*\n)", "captures": { "1": { "name": "variable.other.object.cs" @@ -3690,7 +4319,7 @@ "begin": "(?x)\n(new)(?:\\s+\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n))?\\s*\n(?=\\()", "beginCaptures": { "1": { - "name": "keyword.other.new.cs" + "name": "keyword.operator.expression.new.cs" }, "2": { "patterns": [ @@ -3708,10 +4337,10 @@ ] }, "object-creation-expression-with-no-parameters": { - "match": "(?x)\n(new)\\s+\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n(?=\\{|$)", + "match": "(?x)\n(new)\\s+\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n(?=\\{|//|/\\*|$)", "captures": { "1": { - "name": "keyword.other.new.cs" + "name": "keyword.operator.expression.new.cs" }, "2": { "patterns": [ @@ -3726,7 +4355,7 @@ "begin": "(?x)\n\\b(new|stackalloc)\\b\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)?\\s*\n(?=\\[)", "beginCaptures": { "1": { - "name": "keyword.other.new.cs" + "name": "keyword.operator.expression.$1.cs" }, "2": { "patterns": [ @@ -3744,14 +4373,17 @@ ] }, "anonymous-object-creation-expression": { - "begin": "\\b(new)\\b\\s*(?=\\{|$)", + "begin": "\\b(new)\\b\\s*(?=\\{|//|/\\*|$)", "beginCaptures": { "1": { - "name": "keyword.other.new.cs" + "name": "keyword.operator.expression.new.cs" } }, "end": "(?<=\\})", "patterns": [ + { + "include": "#comment" + }, { "include": "#initializer-expression" } @@ -3826,10 +4458,10 @@ ] }, "parameter": { - "match": "(?x)\n(?:(?:\\b(ref|params|out|in|this)\\b)\\s+)?\n(?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s+\n(\\g)", + "match": "(?x)\n(?:(?:\\b(ref|params|out|in|this)\\b)\\s+)?\n(?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^()]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s+\n(\\g)", "captures": { "1": { - "name": "storage.modifier.cs" + "name": "storage.modifier.$1.cs" }, "2": { "patterns": [ @@ -3913,11 +4545,25 @@ "argument": { "patterns": [ { - "name": "storage.modifier.cs", - "match": "\\b(ref|out|in)\\b" + "name": "storage.modifier.$1.cs", + "match": "\\b(ref|in)\\b" }, { - "include": "#declaration-expression-local" + "begin": "\\b(out)\\b", + "beginCaptures": { + "1": { + "name": "storage.modifier.out.cs" + } + }, + "end": "(?=,|\\)|\\])", + "patterns": [ + { + "include": "#declaration-expression-local" + }, + { + "include": "#expression" + } + ] }, { "include": "#expression" @@ -3928,7 +4574,7 @@ "begin": "(?x)\n\\b(from)\\b\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)?\n\\s+(\\g)\\b\\s*\n\\b(in)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.query.from.cs" + "name": "keyword.operator.expression.query.from.cs" }, "2": { "patterns": [ @@ -3941,7 +4587,7 @@ "name": "entity.name.variable.range-variable.cs" }, "8": { - "name": "keyword.query.in.cs" + "name": "keyword.operator.expression.query.in.cs" } }, "end": "(?=;|\\))", @@ -3980,7 +4626,7 @@ "begin": "(?x)\n\\b(let)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=)\\s*", "beginCaptures": { "1": { - "name": "keyword.query.let.cs" + "name": "keyword.operator.expression.query.let.cs" }, "2": { "name": "entity.name.variable.range-variable.cs" @@ -4003,7 +4649,7 @@ "begin": "(?x)\n\\b(where)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.query.where.cs" + "name": "keyword.operator.expression.query.where.cs" } }, "end": "(?=;|\\))", @@ -4020,7 +4666,7 @@ "begin": "(?x)\n\\b(join)\\b\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)?\n\\s+(\\g)\\b\\s*\n\\b(in)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.query.join.cs" + "name": "keyword.operator.expression.query.join.cs" }, "2": { "patterns": [ @@ -4033,7 +4679,7 @@ "name": "entity.name.variable.range-variable.cs" }, "8": { - "name": "keyword.query.in.cs" + "name": "keyword.operator.expression.query.in.cs" } }, "end": "(?=;|\\))", @@ -4059,7 +4705,7 @@ "match": "\\b(on)\\b\\s*", "captures": { "1": { - "name": "keyword.query.on.cs" + "name": "keyword.operator.expression.query.on.cs" } } }, @@ -4067,7 +4713,7 @@ "match": "\\b(equals)\\b\\s*", "captures": { "1": { - "name": "keyword.query.equals.cs" + "name": "keyword.operator.expression.query.equals.cs" } } }, @@ -4075,7 +4721,7 @@ "match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*", "captures": { "1": { - "name": "keyword.query.into.cs" + "name": "keyword.operator.expression.query.into.cs" }, "2": { "name": "entity.name.variable.range-variable.cs" @@ -4086,7 +4732,7 @@ "begin": "\\b(orderby)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.query.orderby.cs" + "name": "keyword.operator.expression.query.orderby.cs" } }, "end": "(?=;|\\))", @@ -4106,13 +4752,10 @@ ] }, "ordering-direction": { - "match": "\\b(?:(ascending)|(descending))\\b", + "match": "\\b(ascending|descending)\\b", "captures": { "1": { - "name": "keyword.query.ascending.cs" - }, - "2": { - "name": "keyword.query.descending.cs" + "name": "keyword.operator.expression.query.$1.cs" } } }, @@ -4120,7 +4763,7 @@ "begin": "\\b(select)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.query.select.cs" + "name": "keyword.operator.expression.query.select.cs" } }, "end": "(?=;|\\))", @@ -4137,7 +4780,7 @@ "begin": "\\b(group)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.query.group.cs" + "name": "keyword.operator.expression.query.group.cs" } }, "end": "(?=;|\\))", @@ -4160,7 +4803,7 @@ "match": "\\b(by)\\b\\s*", "captures": { "1": { - "name": "keyword.query.by.cs" + "name": "keyword.operator.expression.query.by.cs" } } }, @@ -4168,7 +4811,7 @@ "match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*", "captures": { "1": { - "name": "keyword.query.into.cs" + "name": "keyword.operator.expression.query.into.cs" }, "2": { "name": "entity.name.variable.range-variable.cs" @@ -4178,119 +4821,138 @@ "anonymous-method-expression": { "patterns": [ { - "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=>)", + "begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n(?:\n (@?[_[:alpha:]][_[:alnum:]]*)\\b|\n (\\()\n (?(?:[^()]|\\(\\g\\))*)\n (\\))\n)\\s*\n(=>)", "beginCaptures": { "1": { - "name": "storage.modifier.cs" + "patterns": [ + { + "match": "async|static", + "name": "storage.modifier.$0.cs" + } + ] }, "2": { "name": "entity.name.variable.parameter.cs" }, "3": { - "name": "keyword.operator.arrow.cs" - } - }, - "end": "(?=\\)|;|}|,)", - "patterns": [ - { - "include": "#block" + "name": "punctuation.parenthesis.open.cs" }, - { - "include": "#ref-modifier" - }, - { - "include": "#expression" - } - ] - }, - { - "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(\\(.*?\\))\\s*\n(=>)", - "beginCaptures": { - "1": { - "name": "storage.modifier.cs" - }, - "2": { + "4": { "patterns": [ { - "include": "#lambda-parameter-list" + "include": "#comment" + }, + { + "include": "#explicit-anonymous-function-parameter" + }, + { + "include": "#implicit-anonymous-function-parameter" + }, + { + "include": "#default-argument" + }, + { + "include": "#punctuation-comma" } ] }, - "3": { + "5": { + "name": "punctuation.parenthesis.close.cs" + }, + "6": { "name": "keyword.operator.arrow.cs" } }, - "end": "(?=\\)|;|}|,)", + "end": "(?=[,;)}])", "patterns": [ { - "include": "#block" + "include": "#intrusive" }, { - "include": "#ref-modifier" + "begin": "(?={)", + "end": "(?=[,;)}])", + "patterns": [ + { + "include": "#block" + }, + { + "include": "#intrusive" + } + ] }, { - "include": "#expression" + "begin": "\\b(ref)\\b|(?=\\S)", + "beginCaptures": { + "1": { + "name": "storage.modifier.ref.cs" + } + }, + "end": "(?=[,;)}])", + "patterns": [ + { + "include": "#expression" + } + ] } ] }, { - "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(?:\\b(delegate)\\b\\s*)", + "begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n\\b(delegate)\\b\\s*", "beginCaptures": { "1": { - "name": "storage.modifier.cs" + "patterns": [ + { + "match": "async|static", + "name": "storage.modifier.$0.cs" + } + ] }, "2": { - "name": "keyword.other.delegate.cs" + "name": "storage.type.delegate.cs" } }, - "end": "(?=\\)|;|}|,)", + "end": "(?<=})|(?=[,;)}])", "patterns": [ { - "include": "#parenthesized-parameter-list" + "include": "#intrusive" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.parenthesis.open.cs" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.parenthesis.close.cs" + } + }, + "patterns": [ + { + "include": "#intrusive" + }, + { + "include": "#explicit-anonymous-function-parameter" + }, + { + "include": "#punctuation-comma" + } + ] }, { "include": "#block" - }, - { - "include": "#expression" } ] } ] }, - "lambda-parameter-list": { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.parenthesis.open.cs" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.parenthesis.close.cs" - } - }, - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#attribute-section" - }, - { - "include": "#lambda-parameter" - }, - { - "include": "#punctuation-comma" - } - ] - }, - "lambda-parameter": { - "match": "(?x)\n(?:\\b(ref|out|in)\\b)?\\s*\n(?:(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s+)?\n(\\g)\\b\\s*\n(?=[,)])", + "explicit-anonymous-function-parameter": { + "match": "(?x)\n(?:\\b(ref|params|out|in)\\b\\s*)?\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?<(?:[^<>]|\\g)*>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^()]|\\g)*\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n\\b(\\g)\\b", "captures": { "1": { - "name": "storage.modifier.cs" + "name": "storage.modifier.$1.cs" }, "2": { "patterns": [ @@ -4304,8 +4966,25 @@ } } }, + "implicit-anonymous-function-parameter": { + "match": "\\@?[_[:alpha:]][_[:alnum:]]*\\b", + "name": "entity.name.variable.parameter.cs" + }, + "default-argument": { + "begin": "=", + "beginCaptures": { + "0": { + "name": "keyword.operator.assignment.cs" + } + }, + "end": "(?=,|\\))", + "patterns": [ + { + "include": "#expression" + } + ] + }, "type": { - "name": "meta.type.cs", "patterns": [ { "include": "#comment" @@ -4333,16 +5012,19 @@ }, { "include": "#type-nullable-suffix" + }, + { + "include": "#type-pointer-suffix" } ] }, "ref-modifier": { - "name": "storage.modifier.cs", - "match": "\\b(ref)\\b" + "name": "storage.modifier.ref.cs", + "match": "\\bref\\b" }, "readonly-modifier": { - "name": "storage.modifier.cs", - "match": "\\b(readonly)\\b" + "name": "storage.modifier.readonly.cs", + "match": "\\breadonly\\b" }, "tuple-type": { "begin": "\\(", @@ -4382,10 +5064,10 @@ } }, "type-builtin": { - "match": "\\b(bool|byte|char|decimal|double|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void|dynamic)\\b", + "match": "\\b(bool|s?byte|u?short|n?u?int|u?long|float|double|decimal|char|string|object|void|dynamic)\\b", "captures": { "1": { - "name": "keyword.type.cs" + "name": "keyword.type.$1.cs" } } }, @@ -4444,9 +5126,6 @@ } }, "patterns": [ - { - "include": "#comment" - }, { "include": "#type" }, @@ -4469,6 +5148,9 @@ } }, "patterns": [ + { + "include": "#intrusive" + }, { "include": "#punctuation-comma" } @@ -4476,11 +5158,11 @@ }, "type-nullable-suffix": { "match": "\\?", - "captures": { - "0": { - "name": "punctuation.separator.question-mark.cs" - } - } + "name": "punctuation.separator.question-mark.cs" + }, + "type-pointer-suffix": { + "match": "\\*", + "name": "punctuation.separator.asterisk.cs" }, "operator-assignment": { "name": "keyword.operator.assignment.cs", @@ -4498,6 +5180,16 @@ "name": "punctuation.accessor.cs", "match": "\\." }, + "intrusive": { + "patterns": [ + { + "include": "#preprocessor" + }, + { + "include": "#comment" + } + ] + }, "preprocessor": { "name": "meta.preprocessor.cs", "begin": "^\\s*(\\#)\\s*", @@ -4803,38 +5495,47 @@ "comment": { "patterns": [ { - "name": "comment.block.cs", - "begin": "/\\*", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.cs" - } - }, - "end": "\\*/", - "endCaptures": { - "0": { - "name": "punctuation.definition.comment.cs" - } - } - }, - { - "begin": "(^\\s+)?(?=//)", - "beginCaptures": { + "name": "comment.block.documentation.cs", + "begin": "(^\\s+)?(///)(?!/)", + "while": "^(\\s*)(///)(?!/)", + "captures": { "1": { "name": "punctuation.whitespace.comment.leading.cs" + }, + "2": { + "name": "punctuation.definition.comment.cs" } }, - "end": "(?=$)", "patterns": [ { - "name": "comment.block.documentation.cs", - "begin": "(?" or most keywords. Also if prefixed // with "||". This should work with most formatting models. // The ((?!%).)* is to ensure this doesn't match inside comments. - "increaseIndentPattern": "^((?!%).)*([{(\\[]|->|after|begin|case|catch|fun|if|of|try|when|(\\|\\|.*))\\s*$", + "increaseIndentPattern": "^((?!%).)*([{(\\[]|->|after|begin|case|catch|fun|if|of|try|when|maybe|else|(\\|\\|.*))\\s*$", // Dedent after brackets, end or lone "->". The latter happens in a spec // with indented types, typically after "when". Only do this if it's _only_ // preceded by whitespace. - "decreaseIndentPattern": "^\\s*([)}\\]]|end|->\\s*$)", + "decreaseIndentPattern": "^\\s*([)}\\]]|end|else|->\\s*$)", // Indent if after an incomplete map association operator, list // comprehension and type specifier. But only once, then return to the // previous indent. diff --git a/plugins/textmate/lib/bundles/erlang/package.json b/plugins/textmate/lib/bundles/erlang/package.json index 8f0069f73909..d1a4c76c8488 100644 --- a/plugins/textmate/lib/bundles/erlang/package.json +++ b/plugins/textmate/lib/bundles/erlang/package.json @@ -1,6 +1,6 @@ { "name": "erlang-ls", - "version": "0.0.40", + "version": "0.0.42", "description": "The Visual Studio Code Extension for the Erlang Language Server", "license": "Apache-2.0", "contributes": { diff --git a/plugins/textmate/lib/bundles/fsharp/cgmanifest.json b/plugins/textmate/lib/bundles/fsharp/cgmanifest.json deleted file mode 100644 index b81869f111a5..000000000000 --- a/plugins/textmate/lib/bundles/fsharp/cgmanifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "ionide/ionide-fsgrammar", - "repositoryUrl": "https://github.com/ionide/ionide-fsgrammar", - "commitHash": "8740e610a367c5e3f15be716acc7207655ced4cf" - } - }, - "license": "MIT", - "description": "The file syntaxes/fsharp.json was included from https://github.com/ionide/ionide-fsgrammar/blob/master/grammar/fsharp.json.", - "version": "0.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/fsharp/syntaxes/fsharp.tmLanguage.json b/plugins/textmate/lib/bundles/fsharp/syntaxes/fsharp.tmLanguage.json index 39c34a97b251..5063f1c5210c 100644 --- a/plugins/textmate/lib/bundles/fsharp/syntaxes/fsharp.tmLanguage.json +++ b/plugins/textmate/lib/bundles/fsharp/syntaxes/fsharp.tmLanguage.json @@ -4,7 +4,7 @@ "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/ionide/ionide-fsgrammar/commit/8740e610a367c5e3f15be716acc7207655ced4cf", + "version": "https://github.com/ionide/ionide-fsgrammar/commit/7d029a46f17637228b2ee85dd02e511c3e8039b3", "name": "fsharp", "scopeName": "source.fsharp", "patterns": [ @@ -574,6 +574,11 @@ "name": "fast-capture.comment.line.double-slash.fsharp", "match": "//" }, + { + "comments": "Capture (*) when inside of (* *) so that it doesn't prematurely end the comment block.", + "name": "fast-capture.comment.line.mul-operator.fsharp", + "match": "\\(\\*\\)" + }, { "include": "#comments" } @@ -590,8 +595,8 @@ }, { "name": "comment.line.markdown.fsharp", - "begin": "///", - "while": "///", + "begin": "(??@^|/])///(?!/)", + "while": "(??@^|/])///(?!/)", "patterns": [ { "include": "text.html.markdown" @@ -600,7 +605,7 @@ }, { "name": "comment.line.double-slash.fsharp", - "match": "//.*$" + "match": "(??@^|/])//(.*$)" } ] }, @@ -630,7 +635,7 @@ }, "abstract_definition": { "name": "abstract.definition.fsharp", - "begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(:)", + "begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(<)?", "end": "\\s*(with)\\b|=|$", "beginCaptures": { "1": { @@ -676,7 +681,7 @@ } }, { - "match": "(?!with|get|set\\b)\\b([\\w0-9'`^._]+)", + "match": "(?!with|get|set\\b)\\s*([\\w0-9'`^._]+)", "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted", "captures": { "1": { @@ -1125,7 +1130,7 @@ }, { "name": "keyword.symbol.fsharp", - "match": "(&&&|\\|\\|\\||\\^\\^\\^|~~~|<<<|>>>|\\|>|:>|:\\?>|:|\\[|\\]|\\;|<>|=|@|\\|\\||&&|{|}|\\||_|\\.\\.|\\,|\\+|\\-|\\*|\\/|\\^|\\!|\\>|\\>\\=|\\>\\>|\\<|\\<\\=|\\(|\\)|\\<\\<)" + "match": "(&&&|\\|\\|\\||\\^\\^\\^|~~~|~\\+|~\\-|<<<|>>>|\\|>|:>|:\\?>|:|\\[|\\]|\\;|<>|=|@|\\|\\||&&|&|%|{|}|\\||_|\\.\\.|\\,|\\+|\\-|\\*|\\/|\\^|\\!|\\>|\\>\\=|\\>\\>|\\<|\\<\\=|\\(|\\)|\\<\\<)" } ] }, @@ -1133,7 +1138,7 @@ "patterns": [ { "name": "entity.name.section.fsharp", - "begin": "\\b(namespace global)|\\b(namespace|module)\\s*(public|internal|private|rec)?\\s+([[:alpha:]][[:alpha:]0-9'_. ]*)", + "begin": "\\b(namespace global)|\\b(namespace|module)\\s*(public|internal|private|rec)?\\s+([[:alpha:]|``][[:alpha:]0-9'_. ]*)", "end": "(\\s?=|\\s|$)", "beginCaptures": { "1": { @@ -1171,7 +1176,7 @@ }, { "name": "namespace.open.fsharp", - "begin": "\\b(open type|open)\\s+([[:alpha:]][[:alpha:]0-9'_]*)(?=(\\.[A-Z][[:alpha:]0-9_]*)*)", + "begin": "\\b(open type|open)\\s+([[:alpha:]|``][[:alpha:]0-9'_]*)(?=(\\.[A-Z][[:alpha:]0-9_]*)*)", "end": "(\\s|$)", "beginCaptures": { "1": { @@ -1331,7 +1336,7 @@ "match": "\\(\\)" }, { - "match": "(\\?{0,1})(``[[:alpha:]0-9'`^:,._ ]+``|(?!private\\b)\\b[\\w[:alpha:]0-9'`<>^._ ]+)", + "match": "(\\?{0,1})(``[[:alpha:]0-9'`^:,._ ]+``|(?!private|struct\\b)\\b[\\w[:alpha:]0-9'`<>^._ ]+)", "captures": { "1": { "name": "keyword.symbol.fsharp" diff --git a/plugins/textmate/lib/bundles/git-base/cgmanifest.json b/plugins/textmate/lib/bundles/git-base/cgmanifest.json deleted file mode 100644 index 0815c34f882f..000000000000 --- a/plugins/textmate/lib/bundles/git-base/cgmanifest.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "textmate/git.tmbundle", - "repositoryUrl": "https://github.com/textmate/git.tmbundle", - "commitHash": "5870cf3f8abad3a6637bdf69250b5d2ded427dc4" - } - }, - "licenseDetail": [ - "Copyright (c) 2008 Tim Harper", - "", - "Permission is hereby granted, free of charge, to any person obtaining", - "a copy of this software and associated documentation files (the\"", - "Software\"), to deal in the Software without restriction, including", - "without limitation the rights to use, copy, modify, merge, publish,", - "distribute, sublicense, and/or sell copies of the Software, and to", - "permit persons to whom the Software is furnished to do so, subject to", - "the following conditions:", - "", - "The above copyright notice and this permission notice shall be", - "included in all copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,", - "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF", - "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND", - "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE", - "LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION", - "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION", - "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." - ], - "license": "MIT", - "version": "0.0.0" - }, - { - "component": { - "type": "git", - "git": { - "name": "walles/git-commit-message-plus", - "repositoryUrl": "https://github.com/walles/git-commit-message-plus", - "commitHash": "35a079dea5a91b087021b40c01a6bb4eb0337a87" - } - }, - "licenseDetail": [ - "Copyright (c) 2023 Johan Walles ", - "", - "Permission is hereby granted, free of charge, to any person obtaining", - "a copy of this software and associated documentation files (the\"", - "Software\"), to deal in the Software without restriction, including", - "without limitation the rights to use, copy, modify, merge, publish,", - "distribute, sublicense, and/or sell copies of the Software, and to", - "permit persons to whom the Software is furnished to do so, subject to", - "the following conditions:", - "", - "The above copyright notice and this permission notice shall be", - "included in all copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,", - "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF", - "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND", - "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE", - "LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION", - "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION", - "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." - ], - "license": "MIT", - "version": "1.0.0", - "description": "The original JSON grammars were derived from https://github.com/microsoft/vscode/blob/e95c74c4c7af876e79ec58df262464467c06df28/extensions/git-base/syntaxes/git-commit.tmLanguage.json. That file was originally copied from https://github.com/textmate/git.tmbundle." - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/git-base/languages/git-commit.language-configuration.json b/plugins/textmate/lib/bundles/git-base/languages/git-commit.language-configuration.json index b61fbe63d34f..6ee9f77f0b40 100644 --- a/plugins/textmate/lib/bundles/git-base/languages/git-commit.language-configuration.json +++ b/plugins/textmate/lib/bundles/git-base/languages/git-commit.language-configuration.json @@ -7,5 +7,14 @@ ["{", "}"], ["[", "]"], ["(", ")"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "'", "close": "'", "notIn": ["string", "comment"] }, + { "open": "\"", "close": "\"", "notIn": ["string"] }, + { "open": "`", "close": "`", "notIn": ["string", "comment"] }, + { "open": "/**", "close": " */", "notIn": ["string"] } ] -} \ No newline at end of file +} diff --git a/plugins/textmate/lib/bundles/git-base/languages/git-rebase.language-configuration.json b/plugins/textmate/lib/bundles/git-base/languages/git-rebase.language-configuration.json index b61fbe63d34f..6ee9f77f0b40 100644 --- a/plugins/textmate/lib/bundles/git-base/languages/git-rebase.language-configuration.json +++ b/plugins/textmate/lib/bundles/git-base/languages/git-rebase.language-configuration.json @@ -7,5 +7,14 @@ ["{", "}"], ["[", "]"], ["(", ")"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "'", "close": "'", "notIn": ["string", "comment"] }, + { "open": "\"", "close": "\"", "notIn": ["string"] }, + { "open": "`", "close": "`", "notIn": ["string", "comment"] }, + { "open": "/**", "close": " */", "notIn": ["string"] } ] -} \ No newline at end of file +} diff --git a/plugins/textmate/lib/bundles/git-base/languages/ignore.language-configuration.json b/plugins/textmate/lib/bundles/git-base/languages/ignore.language-configuration.json index b75f42e22a8f..ad8b8ee5cd86 100644 --- a/plugins/textmate/lib/bundles/git-base/languages/ignore.language-configuration.json +++ b/plugins/textmate/lib/bundles/git-base/languages/ignore.language-configuration.json @@ -1,5 +1,14 @@ { "comments": { "lineComment": "#", - } + }, + "autoClosingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "'", "close": "'", "notIn": ["string", "comment"] }, + { "open": "\"", "close": "\"", "notIn": ["string"] }, + { "open": "`", "close": "`", "notIn": ["string", "comment"] }, + { "open": "/**", "close": " */", "notIn": ["string"] } + ] } diff --git a/plugins/textmate/lib/bundles/go/cgmanifest.json b/plugins/textmate/lib/bundles/go/cgmanifest.json deleted file mode 100644 index f47768ba8611..000000000000 --- a/plugins/textmate/lib/bundles/go/cgmanifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "better-go-syntax", - "repositoryUrl": "https://github.com/jeff-hykin/better-go-syntax/ ", - "commitHash": "54ff898316f8647d77ffcf83880a9556445326f1" - } - }, - "license": "MIT", - "description": "The file syntaxes/go.tmLanguage.json is from https://github.com/jeff-hykin/better-go-syntax/ .", - "version": "1.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/go/syntaxes/go.tmLanguage.json b/plugins/textmate/lib/bundles/go/syntaxes/go.tmLanguage.json index 9aa700887eaf..efd69afbcd27 100644 --- a/plugins/textmate/lib/bundles/go/syntaxes/go.tmLanguage.json +++ b/plugins/textmate/lib/bundles/go/syntaxes/go.tmLanguage.json @@ -1,192 +1,371 @@ { "information_for_contributors": [ - "This file has been converted from https://github.com/jeff-hykin/better-go-syntax/blob/master/export/generated.tmLanguage.json", + "This file has been converted from https://github.com/worlpaker/go-syntax/blob/master/syntaxes/go.tmLanguage.json", "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/jeff-hykin/better-go-syntax/commit/6175663a7a0e23d58ccf9aab95054cb6e5c92aff", + "version": "https://github.com/worlpaker/go-syntax/commit/f53c71e58787fb719399b7c38a08bceaa0c0e2d9", "name": "Go", "scopeName": "source.go", "patterns": [ { - "include": "#comments" - }, - { - "include": "#comments" - }, - { - "comment": "Interpreted string literals", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.go" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.go" - } - }, - "name": "string.quoted.double.go", + "include": "#statements" + } + ], + "repository": { + "statements": { "patterns": [ { - "include": "#string_escaped_char" + "include": "#package_name" }, { - "include": "#string_placeholder" + "include": "#import" + }, + { + "include": "#syntax_errors" + }, + { + "include": "#group-functions" + }, + { + "include": "#group-types" + }, + { + "include": "#group-variables" } ] }, - { - "comment": "Raw string literals", - "begin": "`", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.go" - } - }, - "end": "`", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.go" - } - }, - "name": "string.quoted.raw.go", + "group-functions": { + "comment": "all statements related to functions", "patterns": [ { - "include": "#string_placeholder" + "include": "#function_declaration" + }, + { + "include": "#functions_inline" + }, + { + "include": "#functions" + }, + { + "include": "#built_in_functions" + }, + { + "include": "#support_functions" } ] }, - { - "comment": "Syntax error receiving channels", - "match": "<\\-([\\t ]+)chan\\b", - "captures": { - "1": { - "name": "invalid.illegal.receive-channel.go" - } - } - }, - { - "comment": "Syntax error sending channels", - "match": "\\bchan([\\t ]+)<-", - "captures": { - "1": { - "name": "invalid.illegal.send-channel.go" - } - } - }, - { - "comment": "Syntax error using slices", - "match": "\\[\\](\\s+)", - "captures": { - "1": { - "name": "invalid.illegal.slice.go" - } - } - }, - { - "comment": "Syntax error numeric literals", - "match": "\\b0[0-7]*[89]\\d*\\b", - "name": "invalid.illegal.numeric.go" - }, - { - "comment": "Built-in functions", - "match": "\\b(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\\b(?=\\()", - "name": "support.function.builtin.go" - }, - { - "comment": "Function declarations", - "match": "^(\\bfunc\\b)(?:\\s+(\\([^\\)]+\\)\\s+)?(\\w+)(?=\\())?", - "captures": { - "1": { - "name": "keyword.function.go" + "group-types": { + "comment": "all statements related to types", + "patterns": [ + { + "include": "#other_struct_interface_expressions" }, - "2": { + { + "include": "#type_assertion_inline" + }, + { + "include": "#struct_variables_types" + }, + { + "include": "#interface_variables_types" + }, + { + "include": "#single_type" + }, + { + "include": "#multi_types" + }, + { + "include": "#struct_interface_declaration" + }, + { + "include": "#double_parentheses_types" + }, + { + "include": "#switch_types" + }, + { + "include": "#type-declarations" + } + ] + }, + "group-variables": { + "comment": "all statements related to variables", + "patterns": [ + { + "include": "#var_const_assignment" + }, + { + "include": "#variable_assignment" + }, + { + "include": "#label_loop_variables" + }, + { + "include": "#slice_index_variables" + }, + { + "include": "#property_variables" + }, + { + "include": "#switch_select_case_variables" + }, + { + "include": "#other_variables" + } + ] + }, + "type-declarations": { + "comment": "includes all type declarations", + "patterns": [ + { + "include": "#language_constants" + }, + { + "include": "#comments" + }, + { + "include": "#map_types" + }, + { + "include": "#brackets" + }, + { + "include": "#delimiters" + }, + { + "include": "#keywords" + }, + { + "include": "#operators" + }, + { + "include": "#runes" + }, + { + "include": "#storage_types" + }, + { + "include": "#raw_string_literals" + }, + { + "include": "#string_literals" + }, + { + "include": "#numeric_literals" + }, + { + "include": "#terminators" + } + ] + }, + "type-declarations-without-brackets": { + "comment": "includes all type declarations without brackets (in some cases, brackets need to be captured manually)", + "patterns": [ + { + "include": "#language_constants" + }, + { + "include": "#comments" + }, + { + "include": "#map_types" + }, + { + "include": "#delimiters" + }, + { + "include": "#keywords" + }, + { + "include": "#operators" + }, + { + "include": "#runes" + }, + { + "include": "#storage_types" + }, + { + "include": "#raw_string_literals" + }, + { + "include": "#string_literals" + }, + { + "include": "#numeric_literals" + }, + { + "include": "#terminators" + } + ] + }, + "parameter-variable-types": { + "comment": "function and generic parameter types", + "patterns": [ + { + "match": "\\{", + "name": "punctuation.definition.begin.bracket.curly.go" + }, + { + "match": "\\}", + "name": "punctuation.definition.end.bracket.curly.go" + }, + { + "begin": "(?:([\\w\\.\\*]+)?(\\[))", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + }, + "2": { + "name": "punctuation.definition.begin.bracket.square.go" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.square.go" + } + }, "patterns": [ { - "include": "#brackets" - }, - { - "include": "#operators" + "include": "#generic_param_types" } ] }, - "3": { + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, "patterns": [ { - "match": "\\d\\w*", - "name": "invalid.illegal.identifier.go" - }, - { - "match": "\\w+", - "name": "entity.name.function.go" + "include": "#function_param_types" } ] } - } + ] }, - { - "comment": "Functions", - "match": "(\\bfunc\\b)|(\\w+)(?=\\()", - "captures": { - "1": { - "name": "keyword.function.go" - }, - "2": { - "patterns": [ - { - "match": "\\d\\w*", - "name": "invalid.illegal.identifier.go" - }, - { - "match": "\\w+", - "name": "support.function.go" - } - ] - } - } - }, - { - "include": "#numeric_literals" - }, - { + "language_constants": { "comment": "Language constants", "match": "\\b(true|false|nil|iota)\\b", "name": "constant.language.go" }, - { - "begin": "\\b(package)\\s+", - "beginCaptures": { - "1": { - "name": "keyword.package.go" - } - }, - "end": "(?!\\G)", + "comments": { "patterns": [ { - "match": "\\d\\w*", - "name": "invalid.illegal.identifier.go" + "name": "comment.block.go", + "begin": "(\\/\\*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.go" + } + }, + "end": "(\\*\\/)", + "endCaptures": { + "1": { + "name": "punctuation.definition.comment.go" + } + } }, { - "match": "\\w+", - "name": "entity.name.package.go" + "name": "comment.line.double-slash.go", + "begin": "(\\/\\/)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.go" + } + }, + "end": "(?:\\n|$)" } ] }, - { - "begin": "\\b(type)\\s+", + "map_types": { + "comment": "map types", + "begin": "(?:(\\bmap\\b)(\\[))", "beginCaptures": { "1": { - "name": "keyword.type.go" + "name": "keyword.map.go" + }, + "2": { + "name": "punctuation.definition.begin.bracket.square.go" + } + }, + "end": "(?:(\\])((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?\\b(?:func|struct|map)\\b)[\\w\\.\\[\\]\\*]+)?)", + "endCaptures": { + "1": { + "name": "punctuation.definition.end.bracket.square.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] } }, - "end": "(?!\\G)", "patterns": [ { - "match": "\\d\\w*", - "name": "invalid.illegal.identifier.go" + "include": "#type-declarations-without-brackets" + }, + { + "include": "#generic_types" + }, + { + "include": "#functions" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\{", + "name": "punctuation.definition.begin.bracket.curly.go" + }, + { + "match": "\\}", + "name": "punctuation.definition.end.bracket.curly.go" + }, + { + "match": "\\(", + "name": "punctuation.definition.begin.bracket.round.go" + }, + { + "match": "\\)", + "name": "punctuation.definition.end.bracket.round.go" }, { "match": "\\w+", @@ -194,118 +373,16 @@ } ] }, - { - "begin": "\\b(import)\\s+", - "beginCaptures": { - "1": { - "name": "keyword.import.go" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "include": "#imports" - } - ] - }, - { - "begin": "\\b(var)\\s+", - "beginCaptures": { - "1": { - "name": "keyword.var.go" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "include": "#variables" - } - ] - }, - { - "match": "(?,\\s*\\w+(?:\\.\\w+)*)*)(?=\\s*=(?!=))", - "captures": { - "1": { - "patterns": [ - { - "match": "\\d\\w*", - "name": "invalid.illegal.identifier.go" - }, - { - "match": "\\w+(?:\\.\\w+)*", - "name": "variable.other.assignment.go", - "captures": { - "0": { - "patterns": [ - { - "include": "#delimiters" - } - ] - } - } - }, - { - "include": "#delimiters" - } - ] - } - } - }, - { - "match": "\\b\\w+(?:,\\s*\\w+)*(?=\\s*:=)", - "captures": { - "0": { - "patterns": [ - { - "match": "\\d\\w*", - "name": "invalid.illegal.identifier.go" - }, - { - "match": "\\w+", - "name": "variable.other.assignment.go" - }, - { - "include": "#delimiters" - } - ] - } - } - }, - { - "comment": "Terminators", - "match": ";", - "name": "punctuation.terminator.go" - }, - { - "include": "#brackets" - }, - { - "include": "#delimiters" - }, - { - "include": "#keywords" - }, - { - "include": "#operators" - }, - { - "include": "#runes" - }, - { - "include": "#storage_types" - } - ], - "repository": { "brackets": { "patterns": [ { - "begin": "{", + "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.definition.begin.bracket.curly.go" } }, - "end": "}", + "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.end.bracket.curly.go" @@ -337,44 +414,30 @@ ] }, { - "match": "\\[|\\]", - "name": "punctuation.definition.bracket.square.go" - } - ] - }, - "comments": { - "patterns": [ - { - "name": "comment.block.go", - "begin": "(\\/\\*)", + "begin": "\\[", "beginCaptures": { - "1": { - "name": "punctuation.definition.comment.go" + "0": { + "name": "punctuation.definition.begin.bracket.square.go" } }, - "end": "(\\*\\/)", + "end": "\\]", "endCaptures": { - "1": { - "name": "punctuation.definition.comment.go" - } - } - }, - { - "name": "comment.line.double-slash.go", - "begin": "(\\/\\/)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.comment.go" + "0": { + "name": "punctuation.definition.end.bracket.square.go" } }, - "end": "(?:\\n|$)" + "patterns": [ + { + "include": "$self" + } + ] } ] }, "delimiters": { "patterns": [ { - "match": ",", + "match": "\\,", "name": "punctuation.other.comma.go" }, { @@ -387,52 +450,6 @@ } ] }, - "imports": { - "patterns": [ - { - "match": "((?!\\s+\")[^\\s]*)?\\s*((\")([^\"]*)(\"))", - "captures": { - "1": { - "name": "entity.alias.import.go" - }, - "2": { - "name": "string.quoted.double.go" - }, - "3": { - "name": "punctuation.definition.string.begin.go" - }, - "4": { - "name": "entity.name.import.go" - }, - "5": { - "name": "punctuation.definition.string.end.go" - } - } - }, - { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.imports.begin.bracket.round.go" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.imports.end.bracket.round.go" - } - }, - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#imports" - } - ] - } - ] - }, "keywords": { "patterns": [ { @@ -448,6 +465,10 @@ "match": "\\bconst\\b", "name": "keyword.const.go" }, + { + "match": "\\bvar\\b", + "name": "keyword.var.go" + }, { "match": "\\bfunc\\b", "name": "keyword.function.go" @@ -463,6 +484,14 @@ { "match": "\\bstruct\\b", "name": "keyword.struct.go" + }, + { + "match": "\\bimport\\b", + "name": "keyword.control.import.go" + }, + { + "match": "\\btype\\b", + "name": "keyword.type.go" } ] }, @@ -470,7 +499,7 @@ "comment": "Note that the order here is very important!", "patterns": [ { - "match": "(\\*|&)(?=\\w)", + "match": "((?:\\*|\\&)+)(?:(?!\\d)(?=(?:[\\w\\[\\]])|(?:\\<\\-)))", "name": "keyword.operator.address.go" }, { @@ -502,7 +531,7 @@ "name": "keyword.operator.arithmetic.go" }, { - "match": "(&(?!\\^)|\\||\\^|&\\^|<<|>>)", + "match": "(&(?!\\^)|\\||\\^|&\\^|<<|>>|\\~)", "name": "keyword.operator.arithmetic.bitwise.go" }, { @@ -569,6 +598,59 @@ { "match": "\\buintptr\\b", "name": "storage.type.uintptr.go" + }, + { + "match": "\\bany\\b", + "name": "entity.name.type.any.go" + } + ] + }, + "raw_string_literals": { + "comment": "Raw string literals", + "begin": "`", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.go" + } + }, + "end": "`", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.go" + } + }, + "name": "string.quoted.raw.go", + "patterns": [ + { + "include": "#string_placeholder" + } + ] + }, + "string_literals": { + "patterns": [ + { + "comment": "Interpreted string literals", + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.go" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.go" + } + }, + "name": "string.quoted.double.go", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#string_placeholder" + } + ] } ] }, @@ -592,86 +674,6 @@ } ] }, - "variables": { - "patterns": [ - { - "match": "(\\w+(?:,\\s*\\w+)*)(\\s+\\*?\\w+(?:\\.\\w+)?\\s*)?(?=\\s*=)", - "captures": { - "1": { - "patterns": [ - { - "match": "\\d\\w*", - "name": "invalid.illegal.identifier.go" - }, - { - "match": "\\w+", - "name": "variable.other.assignment.go" - }, - { - "include": "#delimiters" - } - ] - }, - "2": { - "patterns": [ - { - "include": "$self" - } - ] - } - } - }, - { - "match": "(\\w+(?:,\\s*\\w+)*)(\\s+(\\[(\\d*|\\.\\.\\.)\\])*\\*?(<-)?\\w+(?:\\.\\w+)?\\s*[^=].*)", - "captures": { - "1": { - "patterns": [ - { - "match": "\\d\\w*", - "name": "invalid.illegal.identifier.go" - }, - { - "match": "\\w+", - "name": "variable.other.declaration.go" - }, - { - "include": "#delimiters" - } - ] - }, - "2": { - "patterns": [ - { - "include": "$self" - } - ] - } - } - }, - { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.variables.begin.bracket.round.go" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.variables.end.bracket.round.go" - } - }, - "patterns": [ - { - "include": "$self" - }, - { - "include": "#variables" - } - ] - } - ] - }, "numeric_literals": { "match": "(?\\-]+(?:\\s*)(?:\\/(?:\\/|\\*).*)?)$)", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + } + }, + { + "include": "$self" + } + ] + }, + "function_param_types": { + "comment": "function parameter variables and types", + "patterns": [ + { + "include": "#struct_variables_types" + }, + { + "include": "#type-declarations-without-brackets" + }, + { + "comment": "struct type declaration", + "match": "((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)\\s+(?=(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\[\\]\\*]+)?\\bstruct\\b\\s*\\{)", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + } + } + }, + { + "comment": "multiple parameters one type -with multilines", + "match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\b\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + } + } + }, + { + "comment": "multiple params and types | multiple params one type | one param one type", + "match": "(?:((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)(?:\\s+)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?:(?:[\\w\\[\\]\\.\\*]+)?(?:(?:\\bfunc\\b\\((?:[^\\)]+)?\\))(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*))+(?:(?:(?:[\\w\\*\\.\\[\\]]+)|(?:\\((?:[^\\)]+)?\\))))?)|(?:(?:[\\[\\]\\*]+)?[\\w\\*\\.]+(?:\\[(?:[^\\]]+)\\])?(?:[\\w\\.\\*]+)?)+)))", + "captures": { + "1": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + } + }, + { + "include": "#parameter-variable-types" + }, + { + "comment": "other types", + "match": "([\\w\\.]+)", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + } + }, + { + "include": "$self" + } + ] + }, + "generic_param_types": { + "comment": "generic parameter variables and types", + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "comment": "multiple parameters one type -with multilines", + "match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\b\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + } + } + }, + { + "comment": "multiple params and types | multiple types one param", + "match": "(?:((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)(?:\\s+)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?:(?:[\\w\\[\\]\\.\\*]+)?(?:(?:\\bfunc\\b\\((?:[^\\)]+)?\\))(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*))+(?:(?:(?:[\\w\\*\\.]+)|(?:\\((?:[^\\)]+)?\\))))?)|(?:(?:(?:[\\w\\*\\.\\~]+)|(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\]))(?:[\\w\\.\\*]+)?)+)))", + "captures": { + "1": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + } + }, + { + "include": "#parameter-variable-types" + }, + { + "comment": "other types", + "match": "(?:\\b([\\w\\.]+))", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + } + }, + { + "include": "$self" + } + ] + }, + "functions": { + "comment": "Functions", + "begin": "(?:(\\bfunc\\b)(?=\\())", + "beginCaptures": { + "1": { + "name": "keyword.function.go" + } + }, + "end": "(?:(?<=\\))(\\s*(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?((?:(?:\\s*(?:(?:[\\[\\]\\*]+)?[\\w\\.\\*]+)?(?:(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\])|(?:\\((?:[^\\)]+)?\\)))?(?:[\\w\\.\\*]+)?)(?:\\s*)(?=\\{))|(?:\\s*(?:(?:(?:[\\[\\]\\*]+)?(?!\\bfunc\\b)(?:[\\w\\.\\*]+)(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\])?(?:[\\w\\.\\*]+)?)|(?:\\((?:[^\\)]+)?\\)))))?)", + "endCaptures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "patterns": [ + { + "include": "#parameter-variable-types" + } + ] + }, + "functions_inline": { + "comment": "functions in-line with multi return types", + "match": "(?:(\\bfunc\\b)((?:\\((?:[^/]*?)\\))(?:\\s+)(?:\\((?:[^/]*?)\\)))(?:\\s+)(?=\\{))", + "captures": { + "1": { + "name": "keyword.function.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "include": "#function_param_types" + }, + { + "include": "$self" + } + ] + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\{", + "name": "punctuation.definition.begin.bracket.curly.go" + }, + { + "match": "\\}", + "name": "punctuation.definition.end.bracket.curly.go" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + } + }, + "support_functions": { + "comment": "Support Functions", + "match": "(?:(?:((?<=\\.)\\b\\w+)|(\\b\\w+))(\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}\"\\']+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?(?=\\())", + "captures": { + "1": { + "name": "entity.name.function.support.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\d\\w*", + "name": "invalid.illegal.identifier.go" + }, + { + "match": "\\w+", + "name": "entity.name.function.support.go" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\{", + "name": "punctuation.definition.begin.bracket.curly.go" + }, + { + "match": "\\}", + "name": "punctuation.definition.end.bracket.curly.go" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + } + }, + "other_struct_interface_expressions": { + "comment": "struct and interface expression in-line (before curly bracket)", + "patterns": [ + { + "comment": "after control variables must be added exactly here, do not move it! (changing may not affect tests, so be careful!)", + "include": "#after_control_variables" + }, + { + "match": "(\\b[\\w\\.]+)(\\[(?:[^\\]]+)?\\])?(?=\\{)(?|\\<\\=|\\>\\=|\\=\\=|\\!\\=|\\w(?:\\+|/|\\-|\\*|\\%)|\\w(?:\\+|/|\\-|\\*|\\%)\\=|\\|\\||\\&\\&)(?:\\s*)((?![\\[\\]]+)[[:alnum:]\\-\\_\\!\\.\\[\\]\\<\\>\\=\\*/\\+\\%\\:]+)(?:\\s*)(?=\\{))", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "(?:\\w+)", + "name": "variable.other.go" + } + ] + } + } + }, + "syntax_errors": { + "patterns": [ + { + "comment": "Syntax error using slices", + "match": "\\[\\](\\s+)", + "captures": { + "1": { + "name": "invalid.illegal.slice.go" + } + } + }, + { + "comment": "Syntax error numeric literals", + "match": "\\b0[0-7]*[89]\\d*\\b", + "name": "invalid.illegal.numeric.go" + } + ] + }, + "built_in_functions": { + "comment": "Built-in functions", + "patterns": [ + { + "match": "\\b(append|cap|close|complex|copy|delete|imag|len|panic|print|println|real|recover|min|max|clear)\\b(?=\\()", + "name": "entity.name.function.support.builtin.go" + }, + { + "comment": "new keyword", + "begin": "(?:(\\bnew\\b)(\\())", + "beginCaptures": { + "1": { + "name": "entity.name.function.support.builtin.go" + }, + "2": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "include": "#functions" + }, + { + "include": "#struct_variables_types" + }, + { + "include": "#type-declarations" + }, + { + "include": "#generic_types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + }, + { + "include": "$self" + } + ] + }, + { + "comment": "make keyword", + "match": "(?:(\\bmake\\b)(?:(\\()((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?:[\\w\\.\\*\\[\\]\\{\\}]+)?(?:\\[(?:[^\\]]+)?\\])?(?:[\\w\\.\\*\\[\\]\\{\\}]+)?)?((?:\\,\\s*(?:[\\w\\.\\(\\)/\\+\\-\\<\\>\\&\\|\\%\\*]+)?)+)?(\\))))", + "captures": { + "1": { + "name": "entity.name.function.support.builtin.go" + }, + "2": { + "name": "punctuation.definition.begin.bracket.round.go" + }, + "3": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + }, + "4": { + "patterns": [ + { + "include": "$self" + } + ] + }, + "5": { + "name": "punctuation.definition.end.bracket.round.go" + } + } + } + ] + }, + "struct_interface_declaration": { + "comment": "struct, interface type declarations (related to: struct_variables_types, interface_variables_types)", + "match": "(?:(?:^\\s*)(\\btype\\b)(?:\\s*)([\\w\\.]+))", + "captures": { + "1": { + "name": "keyword.type.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + } + }, + "switch_types": { + "comment": "switch type assertions, only highlights types after case keyword", + "begin": "(?<=\\bswitch\\b)(?:\\s*)(?:(\\w+\\s*\\:\\=)?\\s*([\\w\\.\\*\\(\\)\\[\\]]+))(\\.\\(\\btype\\b\\)\\s*)(\\{)", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#operators" + }, + { + "match": "\\w+", + "name": "variable.other.assignment.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#support_functions" + }, + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.go" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "include": "#brackets" + }, + { + "match": "\\btype\\b", + "name": "keyword.type.go" + } + ] + }, + "4": { + "name": "punctuation.definition.begin.bracket.curly.go" + } + }, + "end": "(?:\\})", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.curly.go" + } + }, + "patterns": [ + { + "comment": "types after case keyword with single line", + "match": "(?:^\\s*(\\bcase\\b))(?:\\s+)([\\w\\.\\,\\*\\=\\<\\>\\!\\s]+)(:)(\\s*/(?:/|\\*)\\s*.*)?$", + "captures": { + "1": { + "name": "keyword.control.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + }, + "3": { + "name": "punctuation.other.colon.go" + }, + "4": { + "patterns": [ + { + "include": "#comments" + } + ] + } + } + }, + { + "comment": "types after case keyword with multi lines", + "begin": "\\bcase\\b", + "beginCaptures": { + "0": { + "name": "keyword.control.go" + } + }, + "end": "\\:", + "endCaptures": { + "0": { + "name": "punctuation.other.colon.go" + } + }, + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + }, + { + "include": "$self" + } + ] + }, + "var_const_assignment": { + "comment": "variable assignment with var and const keyword", + "patterns": [ + { + "comment": "var and const with single type assignment", + "match": "(?:(?<=\\bvar\\b|\\bconst\\b)(?:\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "\\w+", + "name": "variable.other.assignment.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#generic_types" + }, + { + "match": "\\(", + "name": "punctuation.definition.begin.bracket.round.go" + }, + { + "match": "\\)", + "name": "punctuation.definition.end.bracket.round.go" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + } + }, + { + "comment": "var and const with multi type assignment", + "begin": "(?:(?<=\\bvar\\b|\\bconst\\b)(?:\\s*)(\\())", + "beginCaptures": { + "1": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "match": "(?:(?:^\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "\\w+", + "name": "variable.other.assignment.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#generic_types" + }, + { + "match": "\\(", + "name": "punctuation.definition.begin.bracket.round.go" + }, + { + "match": "\\)", + "name": "punctuation.definition.end.bracket.round.go" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + } + }, + { + "include": "$self" + } + ] + } + ] + }, + "variable_assignment": { + "comment": "variable assignment", + "patterns": [ + { + "comment": "variable assignment with :=", + "match": "\\b\\w+(?:\\,\\s*\\w+)*(?=\\s*:=)", + "captures": { + "0": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "\\d\\w*", + "name": "invalid.illegal.identifier.go" + }, + { + "match": "\\w+", + "name": "variable.other.assignment.go" + } + ] + } + } + }, + { + "comment": "variable assignment with =", + "match": "\\b[\\w\\.\\*]+(?:\\,\\s*[\\w\\.\\*]+)*(?=\\s*=(?!=))", + "captures": { + "0": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "include": "#operators" + }, + { + "match": "\\d\\w*", + "name": "invalid.illegal.identifier.go" + }, + { + "match": "\\w+", + "name": "variable.other.assignment.go" + } + ] + } + } + } + ] + }, + "generic_types": { + "comment": "Generic support for all types", + "match": "(?:([\\w\\.\\*]+)(\\[(?:[^\\]]+)?\\]))", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#parameter-variable-types" + } + ] + } + } + }, + "switch_select_case_variables": { + "comment": "variables after case control keyword in switch/select expression, to not scope them as property variables", + "match": "(?:(?:^\\s*(\\bcase\\b))(?:\\s+)([\\s\\S]+(?:\\:)\\s*(?:/(?:/|\\*).*)?)$)", + "captures": { + "1": { + "name": "keyword.control.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "include": "#support_functions" + }, + { + "include": "#variable_assignment" + }, + { + "match": "\\w+", + "name": "variable.other.go" + } + ] + } + } + }, + "slice_index_variables": { + "comment": "slice index and capacity variables, to not scope them as property variables", + "match": "(?<=\\w\\[)((?:(?:\\b[\\w\\.\\*\\+/\\-\\*\\%\\<\\>\\|\\&]+\\:)|(?:\\:\\b[\\w\\.\\*\\+/\\-\\*\\%\\<\\>\\|\\&]+))(?:\\b[\\w\\.\\*\\+/\\-\\*\\%\\<\\>\\|\\&]+)?(?:\\:\\b[\\w\\.\\*\\+/\\-\\*\\%\\<\\>\\|\\&]+)?)(?=\\])", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.go" + } + ] + } + } + }, + "property_variables": { + "comment": "Property variables in struct | parameter field in struct initialization", + "match": "(?:(?:((?:\\b[\\w\\.]+)(?:\\:(?!\\=))))(?:(?:\\s*([\\w\\.\\*\\&\\[\\]]+)(\\.\\w+)(?![\\w\\.\\*\\&\\[\\]]*(?:\\{|\\()))((?:\\s*(?:\\<|\\>|\\<\\=|\\>\\=|\\=\\=|\\!\\=|\\|\\||\\&\\&|\\+|/|\\-|\\*|\\%|\\||\\&)\\s*(?:[\\w\\.\\*\\&\\[\\]]+)(?:\\.\\w+)(?![\\w\\.\\*\\&\\[\\]]*(?:\\{|\\()))*))?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.property.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.go" + }, + { + "include": "$self" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.property.field.go" + }, + { + "include": "$self" + } + ] + }, + "4": { + "patterns": [ + { + "match": "([\\w\\.\\*\\&\\[\\]]+)(\\.\\w+)", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.property.field.go" + } + ] + } + } + }, + { + "include": "$self" + } + ] + } + } + }, + "label_loop_variables": { + "comment": "labeled loop variable name", + "match": "((?:^\\s*\\w+:\\s*$)|(?:^\\s*(?:\\bbreak\\b|\\bgoto\\b|\\bcontinue\\b)\\s+\\w+(?:\\s*/(?:/|\\*)\\s*.*)?$))", + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.label.go" + } + ] + } + } + }, + "double_parentheses_types": { + "comment": "double parentheses types", + "match": "(?:(?(['\"])(?:[^\\\\]|\\\\.)*?(\\6)))))?\\s*(\\])", - "name": "meta.attribute-selector.css" + "end": "\\s*(\\})", + "endCaptures": { + "1": { + "name": "punctuation.definition.block.begin.less" + } + }, + "name": "meta.at-rule.counter-style.less", + "patterns": [ + { + "include": "#comment-block" + }, + { + "include": "#rule-list" + } + ] }, - { - "begin": "((@)import\\b)", + "at-custom-media": { + "begin": "(?=\\s*@custom-media\\b)", + "end": "\\s*(?=;)", + "name": "meta.at-rule.custom-media.less", + "patterns": [ + { + "captures": { + "0": { + "name": "punctuation.section.property-list.less" + } + }, + "match": "\\s*;" + }, + { + "captures": { + "1": { + "name": "keyword.control.at-rule.custom-media.less" + }, + "2": { + "name": "punctuation.definition.keyword.less" + }, + "3": { + "name": "support.constant.custom-media.less" + } + }, + "match": "\\s*((@)custom-media)(?=.*?)" + }, + { + "include": "#media-query-list" + } + ] + }, + "at-font-face": { + "begin": "\\s*((@)font-face)\\s*(?=\\{|$)", + "captures": { + "1": { + "name": "keyword.control.at-rule.font-face.less" + }, + "2": { + "name": "punctuation.definition.keyword.less" + } + }, + "end": "\\s*(\\})", + "endCaptures": { + "1": { + "name": "punctuation.definition.block.end.less" + } + }, + "name": "meta.at-rule.font-face.less", + "patterns": [ + { + "include": "#comment-block" + }, + { + "include": "#rule-list" + } + ] + }, + "at-import": { + "begin": "\\s*((@)import\\b)\\s*", "beginCaptures": { "1": { "name": "keyword.control.at-rule.import.less" @@ -186,357 +158,4860 @@ "name": "punctuation.definition.keyword.less" } }, - "end": ";", + "end": "\\;", "endCaptures": { "0": { - "name": "punctuation.terminator.rule.css" + "name": "punctuation.terminator.rule.less" } }, - "name": "meta.at-rule.import.css", + "name": "meta.at-rule.import.less", "patterns": [ { - "match": "(?<=\\(|,|\\s)\\b(reference|optional|once|multiple|less|inline)\\b(?=\\)|,)", - "name": "keyword.control.import.option.less" + "include": "#url-function" }, { - "include": "#brace_round" + "include": "#less-variables" }, { - "include": "source.css#commas" - }, - { - "include": "#strings" - } - ] - }, - { - "captures": { - "1": { - "name": "keyword.control.at-rule.fontface.css" - }, - "2": { - "name": "punctuation.definition.keyword.css" - } - }, - "match": "^\\s*((@)font-face\\b)", - "name": "meta.at-rule.fontface.css" - }, - { - "captures": { - "1": { - "name": "keyword.control.at-rule.media.css" - }, - "2": { - "name": "punctuation.definition.keyword.css" - } - }, - "match": "^\\s*((@)media\\b)", - "name": "meta.at-rule.media.css" - }, - { - "include": "source.css#media-features" - }, - { - "match": "\\b(tv|tty|screen|projection|print|handheld|embossed|braille|aural|all)\\b", - "name": "support.constant.media-type.media.css" - }, - { - "match": "\\b(portrait|landscape)\\b", - "name": "support.constant.property-value.media-property.media.css" - }, - { - "captures": { - "1": { - "name": "support.function.less" - } - }, - "match": "(\\.[a-zA-Z0-9_-]+)\\s*(;|\\()" - }, - { - "begin": "(^[ \\t]+)?(?=//)", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.less" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.less" - } - }, - "end": "\\n", - "name": "comment.line.double-slash.less" - } - ] - }, - { - "match": "(@|\\-\\-)[\\w-]+(?=\\s*)", - "name": "variable.other.less", - "captures": { - "1": { - "name": "punctuation.definition.variable.less" - } - } - }, - { - "include": "#variable_interpolation" - }, - { - "begin": "{", - "beginCaptures": { - "0": { - "name": "punctuation.section.property-list.begin.bracket.curly.css" - } - }, - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.section.property-list.end.bracket.curly.css" - } - }, - "name": "meta.property-list.css", - "patterns": [ - { - "include": "source.css#pseudo-elements" - }, - { - "include": "source.css#pseudo-classes" - }, - { - "include": "source.css#tag-names" - }, - { - "include": "source.css#commas" - }, - { - "include": "#variable_interpolation" - }, - { - "include": "source.css#property-names" - }, - { - "include": "#property_values" - }, - { - "include": "$self" - } - ] - }, - { - "match": "\\!\\s*important", - "name": "keyword.other.important.css" - }, - { - "match": "\\*|\\/|\\-|\\+|~|=|<=|>=|<|>", - "name": "keyword.operator.less" - }, - { - "match": "\\b(not|and|when)\\b", - "name": "keyword.control.logical.operator.less" - }, - { - "include": "source.css#tag-names" - }, - { - "match": "(?)=?))\\s*" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.group.less", + "patterns": [ + { + "include": "#less-logical-comparisons" + } + ] + }, + { + "match": "\\btrue|false\\b", + "name": "constant.language.less" + }, + { + "match": ",", + "name": "punctuation.separator.less" + }, + { + "include": "#property-values" + }, + { + "include": "#selectors" + }, + { + "include": "#unquoted-string" + } + ] + }, + "less-math": { + "patterns": [ + { + "match": "[-\\+\\*\\/]", + "name": "keyword.operator.arithmetic.less" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.group.less", + "patterns": [ + { + "include": "#less-math" + } + ] + }, + { + "include": "#numeric-values" + }, + { + "include": "#less-variables" + } + ] + }, + "less-math-functions": { + "patterns": [ + { + "begin": "\\b(ceil|floor|percentage|round|sqrt|abs|a?(sin|cos|tan))(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.math.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#numeric-values" + } + ] + } + ] + }, + { + "captures": { + "2": { + "name": "support.function.math.less" + }, + "3": { + "name": "punctuation.definition.group.begin.less" + }, + "4": { + "name": "punctuation.definition.group.end.less" + } + }, + "match": "((pi)(\\()(\\)))", + "name": "meta.function-call.less" + }, + { + "begin": "\\b(pow|m(od|in|ax))(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.math.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#numeric-values" + }, + { + "include": "#comma-delimiter" + } + ] + } + ] + } + ] + }, + "less-misc-functions": { + "patterns": [ + { + "begin": "\\b(color)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.color.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#literal-string" + } + ] + } + ] + }, + { + "begin": "\\b(image-(size|width|height))(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.image.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#literal-string" + }, + { + "include": "#unquoted-string" + } + ] + } + ] + }, + { + "begin": "\\b(convert|unit)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.convert.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#dimensions" + }, + { + "include": "#numeric-values" + }, + { + "include": "#literal-string" + }, + { + "include": "#comma-delimiter" + }, + { + "match": "((c|m)?m|in|p(t|c|x)|m?s|g?rad|deg|turn|%|r?em|ex|ch)", + "name": "keyword.other.unit.less" + } + ] + } + ] + }, + { + "begin": "\\b(data-uri)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.data-uri.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#literal-string" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.less" + } + }, + "match": "\\s*(?:(,))" + } + ] + } + ] + }, + { + "captures": { + "2": { + "name": "punctuation.definition.group.begin.less" + }, + "3": { + "name": "punctuation.definition.group.end.less" + } + }, + "match": "\\b(default(\\()(\\)))\\b", + "name": "support.function.default.less" + }, + { + "begin": "\\b(get-unit)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.get-unit.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#dimensions" + } + ] + } + ] + }, + { + "begin": "\\b(svg-gradient)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.svg-gradient.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#angle-type" + }, + { + "include": "#comma-delimiter" + }, + { + "include": "#color-values" + }, + { + "include": "#percentage-type" + }, + { + "include": "#length-type" + }, + { + "match": "\\bto\\b", + "name": "keyword.other.less" + }, + { + "match": "\\b(top|right|bottom|left|center)\\b", + "name": "support.constant.property-value.less" + }, + { + "match": "\\b(at|circle|ellipse)\\b", + "name": "keyword.other.less" + } + ] + } + ] + } + ] + }, + "less-mixin-guards": { + "patterns": [ + { + "begin": "\\s*(and|not|or)?\\s*(?=\\()", + "beginCaptures": { + "1": { + "name": "keyword.operator.logical.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "name": "meta.group.less", + "patterns": [ + { + "include": "#less-variable-comparison" + }, + { + "captures": { + "1": { + "name": "meta.group.less" + }, + "2": { + "name": "punctuation.definition.group.begin.less" + }, + "3": { + "name": "punctuation.definition.group.end.less" + } + }, + "match": "default((\\()(\\)))", + "name": "support.function.default.less" + }, + { + "include": "#property-values" + }, + { + "include": "#less-logical-comparisons" + }, + { + "include": "$self" + } + ] + } + ] + } + ] + }, + "less-namespace-accessors": { + "patterns": [ + { + "begin": "(?=\\s*when\\b)", + "end": "\\s*(?:(,)|(?=[{;]))", + "endCaptures": { + "1": { + "name": "punctuation.definition.block.end.less" + } + }, + "name": "meta.conditional.guarded-namespace.less", + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.control.conditional.less" + }, + "2": { + "name": "punctuation.definition.keyword.less" + } + }, + "match": "\\s*(when)(?=.*?)" + }, + { + "include": "#less-mixin-guards" + }, + { + "include": "#comma-delimiter" + }, + { + "begin": "\\s*(\\{)", + "beginCaptures": { + "1": { + "name": "punctuation.section.property-list.begin.less" + } + }, + "end": "(?=\\})", + "name": "meta.block.less", + "patterns": [ + { + "include": "#rule-list-body" + } + ] + }, + { + "include": "#selectors" + } + ] + }, + { + "begin": "(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.definition.group.end.less" + }, + "2": { + "name": "punctuation.terminator.rule.less" + } + }, + "name": "meta.group.less", + "patterns": [ + { + "include": "#less-variable-assignment" + }, + { + "include": "#comma-delimiter" + }, + { + "captures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "match": "\\s*(;)|(?=[})])" + }, + { + "include": "#property-values" + }, + { + "include": "#rule-list-body" + } + ] + } + ] + }, + "less-number-units": { + "patterns": [ + { + "match": "\\b((c|m)?m|in|p(t|c)|m?s|g?rad|deg|turn)\\b", + "name": "keyword.other.unit.less" + }, + { + "match": "\\b(r?em|ex|ch|vw|vh|vmin|vmax|cm|mm|q|in|pt|pc|px|fr|s|ms|Hz|kHz|dpi|dpcm|dppx|deg|grad|rad|turn)\\b" + } + ] + }, + "less-string-functions": { + "patterns": [ + { + "begin": "\\b(e(scape)?)(?=\\()\\b", + "beginCaptures": { + "1": { + "name": "support.function.escape.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#comma-delimiter" + }, + { + "include": "#literal-string" + }, + { + "include": "#unquoted-string" + } + ] + } + ] + }, + { + "begin": "\\s*(%)(?=\\()\\s*", + "beginCaptures": { + "1": { + "name": "support.function.format.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#comma-delimiter" + }, + { + "include": "#literal-string" + }, + { + "include": "#property-values" + } + ] + } + ] + }, + { + "begin": "\\b(replace)(?=\\()\\b", + "beginCaptures": { + "1": { + "name": "support.function.replace.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#comma-delimiter" + }, + { + "include": "#literal-string" + }, + { + "include": "#property-values" + } + ] + } + ] + } + ] + }, + "less-strings": { + "patterns": [ + { + "begin": "(~)('|\")", + "beginCaptures": { + "1": { + "name": "constant.character.escape.less" + }, + "2": { + "name": "punctuation.definition.string.begin.less" + } + }, + "contentName": "markup.raw.inline.less", + "end": "('|\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.less" + }, + "2": { + "name": "invalid.illegal.newline.less" + } + }, + "name": "string.quoted.other.less", + "patterns": [ + { + "include": "#string-content" + } + ] + } + ] + }, + "less-type-functions": { + "patterns": [ + { + "begin": "\\b(is(number|string|color|keyword|url|pixel|em|percentage|ruleset))(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.type.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#property-values" + } + ] + } + ] + }, + { + "begin": "\\b(isunit)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.type.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#property-values" + }, + { + "include": "#comma-delimiter" + }, + { + "match": "(?x)\\b((?i:em|ex|ch|rem)|(?i:vw|vh|vmin|vmax)|(?i:cm|mm|q|in|pt|pc|px|fr)|(?i:deg|grad|rad|turn)|(?i:s|ms)|(?i:Hz|kHz)|(?i:dpi|dpcm|dppx))\\b", + "name": "keyword.other.unit.less" + } + ] + } + ] + }, + { + "begin": "\\b(isdefined)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.type.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + } + ] + } + ] + } + ] + }, + "less-variable-assignment": { + "patterns": [ + { + "begin": "(@)(-?(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*)", + "beginCaptures": { + "0": { + "name": "variable.other.readwrite.less" + }, + "1": { + "name": "punctuation.definition.variable.less" + }, + "2": { + "name": "support.other.variable.less" + } + }, + "end": "\\s*(;|(\\.{3})|(?=\\)))", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + }, + "2": { + "name": "keyword.operator.spread.less" + } + }, + "name": "meta.property-value.less", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.separator.key-value.less" + }, + "4": { + "name": "meta.property-value.less" + } + }, + "match": "(((\\+_?)?):)([\\s\\t]*)" + }, + { + "include": "#property-values" + }, + { + "include": "#comma-delimiter" + }, + { + "include": "#property-list" + }, + { + "include": "#unquoted-string" + } + ] + } + ] + }, + "less-variable-comparison": { + "patterns": [ + { + "begin": "(@{1,2})([-]?([_a-z]|[^\\x{00}-\\x{7F}]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*)", + "beginCaptures": { + "0": { + "name": "variable.other.readwrite.less" + }, + "1": { + "name": "punctuation.definition.variable.less" + }, + "2": { + "name": "support.other.variable.less" + } + }, + "end": "\\s*(?=\\))", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.operator.logical.less" + } + }, + "match": "\\s*(=|((<|>)=?))\\s*" + }, + { + "match": "\\btrue\\b", + "name": "constant.language.less" + }, + { + "include": "#property-values" + }, + { + "include": "#selectors" + }, + { + "include": "#unquoted-string" + }, + { + "match": ",", + "name": "punctuation.separator.less" + } + ] + } + ] + }, + "less-variable-interpolation": { + "captures": { + "1": { + "name": "punctuation.definition.variable.less" + }, + "2": { + "name": "punctuation.definition.expression.less" + }, + "3": { + "name": "support.other.variable.less" + }, + "4": { + "name": "punctuation.definition.expression.less" + } + }, + "match": "(@)(\\{)([-\\w]+)(\\})", + "name": "variable.other.readwrite.less" + }, + "less-variables": { + "captures": { + "1": { + "name": "punctuation.definition.variable.less" + }, + "2": { + "name": "support.other.variable.less" + } + }, + "match": "\\s*(@@?)([-\\w]+)", + "name": "variable.other.readwrite.less" + }, + "literal-string": { + "patterns": [ + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.less" + } + }, + "end": "(')|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.less" + }, + "2": { + "name": "invalid.illegal.newline.less" + } + }, + "name": "string.quoted.single.less", + "patterns": [ + { + "include": "#string-content" + } + ] + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.less" + } + }, + "end": "(\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.less" + }, + "2": { + "name": "invalid.illegal.newline.less" + } + }, + "name": "string.quoted.double.less", + "patterns": [ + { + "include": "#string-content" + } + ] + }, + { + "include": "#less-strings" + } + ] + }, + "local-function": { + "begin": "\\b(local)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.font-face.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#unquoted-string" + } + ] + } + ] + }, + "media-query": { + "begin": "\\s*(only|not)?\\s*(all|aural|braille|embossed|handheld|print|projection|screen|tty|tv)?", + "beginCaptures": { + "1": { + "name": "keyword.operator.logic.media.less" + }, + "2": { + "name": "support.constant.media.less" + } + }, + "end": "\\s*(?:(,)|(?=[{;]))", + "endCaptures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.less" + } + }, + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#custom-property-name" + }, + { + "begin": "\\s*(and)?\\s*(\\()\\s*", + "beginCaptures": { + "1": { + "name": "keyword.operator.logic.media.less" + }, + "2": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.group.less", + "patterns": [ + { + "begin": "((-webkit-|-o-)?((min|max)-)?(-moz-)?(((device-)?(height|width|aspect-ratio|pixel-ratio))|(color(-index)?)|monochrome|resolution))|grid|scan|orientation\\s*(?=[:)])", + "beginCaptures": { + "0": { + "name": "support.type.property-name.media.less" + }, + "2": { + "name": "support.type.vendor-prefix.less" + }, + "5": { + "name": "support.type.vendor-prefix.less" + } + }, + "end": "(((\\+_?)?):)|(?=\\))", + "endCaptures": { + "1": { + "name": "punctuation.separator.key-value.less" + } + } + }, + { + "match": "\\b(portrait|landscape|progressive|interlace)", + "name": "support.constant.property-value.less" + }, + { + "captures": { + "1": { + "name": "constant.numeric.less" + }, + "2": { + "name": "keyword.operator.arithmetic.less" + }, + "3": { + "name": "constant.numeric.less" + } + }, + "match": "\\s*(\\d+)(/)(\\d+)" + }, + { + "include": "#less-math" + } + ] + } + ] + }, + "media-query-list": { + "begin": "\\s*(?=[^{;])", + "end": "\\s*(?=[{;])", + "patterns": [ + { + "include": "#media-query" + } + ] + }, + "minmax-function": { + "begin": "\\b(minmax)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.grid.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#length-type" + }, + { + "include": "#comma-delimiter" + }, + { + "match": "\\b(max-content|min-content)\\b", + "name": "support.constant.property-value.less" + } + ] + } + ] + }, + "number-type": { + "match": "[-+]?(?:(?:\\d*\\.\\d+(?:[eE](?:[-+]?\\d+))*)|(?:[-+]?\\d+))", + "name": "constant.numeric.less" + }, + "numeric-values": { + "patterns": [ + { + "include": "#dimensions" + }, + { + "include": "#percentage-type" + }, + { + "include": "#number-type" + } + ] + }, + "percentage-type": { + "captures": { + "1": { + "name": "keyword.other.unit.less" + } + }, + "match": "[-+]?(?:(?:\\d*\\.\\d+(?:[eE](?:[-+]?\\d+))*)|(?:[-+]?\\d+))(%)", + "name": "constant.numeric.less" + }, + "property-list": { + "patterns": [ + { + "begin": "(?=(?=[^;]*)\\{)", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.end.less" + } + }, + "patterns": [ + { + "include": "#rule-list" + } + ] + } + ] + }, + "property-value-constants": { + "patterns": [ + { + "match": "(?x)\\b(\n absolute|active|add\n |all(-(petite|small)-caps|-scroll)?\n |alpha(betic)?\n |alternate(-reverse)?\n |always|annotation|antialiased|at\n |auto(hiding-scrollbar)?\n |avoid(-column|-page|-region)?\n |background(-color|-image|-position|-size)?\n |backwards|balance|baseline|below|bevel|bicubic|bidi-override|blink\n |block(-line-height)?\n |blur\n |bold(er)?\n |border(-bottom|-left|-right|-top)?-(color|radius|width|style)\n |border-(bottom|top)-(left|right)-radius\n |border-image(-outset|-repeat|-slice|-source|-width)?\n |border(-bottom|-left|-right|-top|-collapse|-spacing|-box)?\n |both|bottom\n |box(-shadow)?\n |break-(all|word)\n |brightness\n |butt(on)?\n |capitalize\n |cent(er|ral)\n |char(acter-variant)?\n |cjk-ideographic|clip|clone|close-quote\n |closest-(corner|side)\n |col-resize|collapse\n |color(-stop|-burn|-dodge)?\n |column((-count|-gap|-reverse|-rule(-color|-width)?|-width)|s)?\n |common-ligatures|condensed|consider-shifts|contain\n |content(-box|s)?\n |contextual|contrast|cover\n |crisp(-e|E)dges\n |crop\n |cross(hair)?\n |da(rken|shed)\n |default|dense|diagonal-fractions|difference|disabled\n |discretionary-ligatures|disregard-shifts\n |distribute(-all-lines|-letter|-space)?\n |dotted|double|drop-shadow\n |(nwse|nesw|ns|ew|sw|se|nw|ne|w|s|e|n)-resize\n |ease(-in-out|-in|-out)?\n |element|ellipsis|embed|end|EndColorStr|evenodd\n |exclu(de(-ruby)?|sion)\n |expanded\n |(extra|semi|ultra)-(condensed|expanded)\n |farthest-(corner|side)?\n |fill(-box|-opacity)?\n |filter|fixed|flat\n |flex((-basis|-end|-grow|-shrink|-start)|box)?\n |flip|flood-color\n |font(-size(-adjust)?|-stretch|-weight)?\n |forwards\n |from(-image)?\n |full-width|geometricPrecision|glyphs|gradient|grayscale\n |grid(-height)?\n |groove|hand|hanging|hard-light|height|help|hidden|hide\n |historical-(forms|ligatures)\n |horizontal(-tb)?\n |hue\n |ideograph(-alpha|-numeric|-parenthesis|-space|ic)\n |inactive|include-ruby|infinite|inherit|initial\n |inline(-block|-box|-flex(box)?|-line-height|-table)?\n |inset|inside\n |inter(-ideograph|-word|sect)\n |invert|isolat(e|ion)|italic\n |jis(04|78|83|90)\n |justify(-all)?\n |keep-all\n |large[r]?\n |last|layout|left|letter-spacing\n |light(e[nr]|ing-color)\n |line(-edge|-height|-through)?\n |linear(-gradient|RGB)?\n |lining-nums|list-item|local|loose|lowercase|lr-tb|ltr\n |lumin(osity|ance)|manual\n |manipulation\n |margin(-bottom|-box|-left|-right|-top)?\n |marker(-offset|s)?\n |mathematical\n |max-(content|height|lines|size|width)\n |medium|middle\n |min-(content|height|width)\n |miter|mixed|move|multiply|newspaper\n |no-(change|clip|(close|open)-quote|(common|discretionary|historical)-ligatures|contextual|drop|repeat)\n |none|nonzero|normal|not-allowed|nowrap|oblique\n |offset(-after|-before|-end|-start)?\n |oldstyle-nums|opacity|open-quote\n |optimize(Legibility|Precision|Quality|Speed)\n |order|ordinal|ornaments\n |outline(-color|-offset|-width)?\n |outset|outside|over(line|-edge|lay)\n |padding(-bottom|-box|-left|-right|-top|-box)?\n |page|painted|paused\n |pan-(x|left|right|y|up|down)\n |perspective-origin\n |petite-caps|pixelated|pointer\n |pinch-zoom\n |pre(-line|-wrap)?\n |preserve-3d\n |progid:DXImageTransform.Microsoft.(Alpha|Blur|dropshadow|gradient|Shadow)\n |progress\n |proportional-(nums|width)\n |radial-gradient|recto|region|relative\n |repeat(-[xy])?\n |repeating-(linear|radial)-gradient\n |replaced|reset-size|reverse|ridge|right\n |round\n |row(-resize|-reverse)?\n |rtl|ruby|running|saturat(e|ion)|screen\n |scroll(-position|bar)?\n |separate|sepia\n |scale-down\n |shape-(image-threshold|margin|outside)\n |show\n |sideways(-lr|-rl)?\n |simplified\n |size\n |slashed-zero|slice\n |small(-caps|er)?\n |smooth|snap|solid|soft-light\n |space(-around|-between)?\n |span|sRGB\n |stack(ed-fractions)?\n |start(ColorStr)?\n |static\n |step-(end|start)\n |sticky\n |stop-(color|opacity)\n |stretch|strict\n |stroke(-box|-dash(array|offset)|-miterlimit|-opacity|-width)?\n |style(set)?\n |stylistic\n |sub(grid|pixel-antialiased|tract)?\n |super|swash\n |table(-caption|-cell|(-column|-footer|-header|-row)-group|-column|-row)?\n |tabular-nums|tb-rl\n |text((-bottom|-(decoration|emphasis)-color|-indent|-(over|under)-edge|-shadow|-size(-adjust)?|-top)|field)?\n |thi(ck|n)\n |titling-ca(ps|se)\n |to[p]?\n |touch|traditional\n |transform(-origin)?\n |under(-edge|line)?\n |unicase|unset|uppercase|upright\n |use-(glyph-orientation|script)\n |verso\n |vertical(-align|-ideographic|-lr|-rl|-text)?\n |view-box\n |viewport-fill(-opacity)?\n |visibility\n |visible(Fill|Painted|Stroke)?\n |wait|wavy|weight|whitespace|(device-)?width|word-spacing\n |wrap(-reverse)?\n |x{1,2}-(large|small)\n |z-index|zero\n |zoom(-in|-out)?\n |((?xi:arabic-indic|armenian|bengali|cambodian|circle|cjk-decimal|cjk-earthly-branch|cjk-heavenly-stem|decimal-leading-zero|decimal|devanagari|disclosure-closed|disclosure-open|disc|ethiopic-numeric|georgian|gujarati|gurmukhi|hebrew|hiragana-iroha|hiragana|japanese-formal|japanese-informal|kannada|katakana-iroha|katakana|khmer|korean-hangul-formal|korean-hanja-formal|korean-hanja-informal|lao|lower-alpha|lower-armenian|lower-greek|lower-latin|lower-roman|malayalam|mongolian|myanmar|oriya|persian|simp-chinese-formal|simp-chinese-informal|square|tamil|telugu|thai|tibetan|trad-chinese-formal|trad-chinese-informal|upper-alpha|upper-armenian|upper-latin|upper-roman)))\\b", + "name": "support.constant.property-value.less" + }, + { + "match": "\\b(?i:sans-serif|serif|monospace|fantasy|cursive)\\b(?=\\s*[;,\\n}])", + "name": "support.constant.font-name.less" + } + ] + }, + "property-values": { + "patterns": [ + { + "include": "#comment-block" + }, + { + "include": "#vendor-prefix" + }, + { + "include": "#builtin-functions" + }, + { + "include": "#color-functions" + }, + { + "include": "#less-math" + }, + { + "include": "#less-functions" + }, + { + "include": "#less-variables" + }, + { + "include": "#unicode-range" + }, + { + "include": "#numeric-values" + }, + { + "include": "#color-values" + }, + { + "include": "#property-value-constants" + }, + { + "include": "#literal-string" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.less" + } + }, + "match": "(\\!)\\s*important", + "name": "keyword.other.important.less" + } + ] + }, + "pseudo-classes": { + "patterns": [ + { + "begin": "(:)(dir|lang)(?=\\()", + "captures": { + "1": { + "name": "punctuation.definition.entity.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "entity.other.attribute-name.pseudo-class.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#unquoted-string" + } + ] + } + ] + }, + { + "begin": "(:)(not)(?=\\()", + "captures": { + "1": { + "name": "punctuation.definition.entity.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "entity.other.attribute-name.pseudo-class.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#selectors" + } + ] + } + ] + }, + { + "begin": "(:)(nth(-last)?-(child|of-type))(?=\\()", + "captures": { + "1": { + "name": "punctuation.definition.entity.less" + }, + "2": { + "name": "entity.other.attribute-name.pseudo-class.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "name": "meta.group.less", + "patterns": [ + { + "match": "\\b(even|odd)\\b", + "name": "keyword.other.pseudo-class.less" + }, + { + "captures": { + "1": { + "name": "keyword.other.unit.less" + } + }, + "match": "(?:[-+]?(?:\\d+)?(n)(\\s*[-+]\\s*\\d+)?|[-+]?\\s*\\d+)", + "name": "constant.numeric.less" + }, + { + "include": "#less-math" + }, + { + "include": "#less-strings" + }, + { + "include": "#less-variable-interpolation" + } + ] + } + ] + }, + { + "begin": "(:)(host-context)(?=\\()", + "captures": { + "1": { + "name": "punctuation.definition.entity.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "entity.other.attribute-name.pseudo-class.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#selectors" + } + ] + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.entity.less" + }, + "2": { + "name": "entity.other.attribute-name.pseudo-class.less" + } + }, + "match": "(:)(active|any|checked|default|disabled|empty|enabled|first(-(child|of-type))?|fullscreen|focus|host|hover|indeterminate|in-range|invalid|last-(child|of-type)|left|link|only-(child|of-type)|optional|out-of-range|read-(only|write)|required|right|root|scope|target|valid|visited)", + "name": "meta.function-call.less" + } + ] + }, + "pseudo-elements": { + "patterns": [ + { + "begin": "(::)(slotted)(?=\\()", + "captures": { + "1": { + "name": "punctuation.definition.entity.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "entity.other.attribute-name.pseudo-class.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#selectors" + } + ] + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.entity.less" + }, + "2": { + "name": "punctuation.definition.entity.less" + }, + "3": { + "name": "support.type.vendor-prefix.less" + } + }, + "match": "(?:(:{1,2})(?:before|after|first-line|first-letter)|(::)(-(?:moz|ms|webkit)-)?(?:(-?(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*)))\\b", + "name": "entity.other.attribute-name.pseudo-element.less" + } + ] + }, + "qualified-name": { + "captures": { + "1": { + "name": "entity.name.constant.less" + }, + "2": { + "name": "entity.name.namespace.wildcard.less" + }, + "3": { + "name": "punctuation.separator.namespace.less" + } + }, + "match": "(?:(-?(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[_a-zA-Z][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*)|(\\*))?([|])(?!=)" + }, + "regexp-function": { + "begin": "\\b(regexp)(?=\\()", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "support.function.regexp.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "name": "meta.function-call.less", + "patterns": [ + { + "include": "#literal-string" + } + ] + } + ] + }, + "resolution-type": { + "captures": { + "1": { + "name": "keyword.other.unit.less" + } + }, + "match": "(?i:[-+]?(?:(?:\\d*\\.\\d+(?:[eE](?:[-+]?\\d+))*)|(?:[-+]?\\d+))(dpi|dpcm|dppx))\\b", + "name": "constant.numeric.less" + }, + "rule-list": { + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.begin.less" + } + }, + "end": "(?=\\s*\\})", + "name": "meta.property-list.less", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "match": "\\s*(;)|(?=[})])" + }, + { + "include": "#rule-list-body" + }, + { + "include": "#less-extend" + } + ] + } + ] + }, + "rule-list-body": { + "patterns": [ + { + "include": "#comment-block" + }, + { + "include": "#comment-line" + }, + { + "include": "#at-rules" + }, + { + "include": "#less-variable-assignment" + }, + { + "include": "#less-variable-interpolation" + }, + { + "begin": "(?=[-a-z])", + "end": "$|(?![-a-z])", + "patterns": [ + { + "include": "#vendor-prefix" + }, + { + "include": "#custom-property-name" + }, + { + "include": "#filter-function" + }, + { + "captures": { + "1": { + "name": "keyword.other.custom-property.prefix.less" + }, + "2": { + "name": "support.type.custom-property.name.less" + } + }, + "match": "\\b(var-)(-?(?:[[-\\w][^\\x{00}-\\x{9f}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[_a-zA-Z][^\\x{00}-\\x{9f}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*)(?=\\s)", + "name": "invalid.deprecated.custom-property.less" + }, + { + "begin": "\\bfont(-family)?(?!-)\\b", + "beginCaptures": { + "0": { + "name": "support.type.property-name.less" + } + }, + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "name": "meta.property-name.less", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.separator.key-value.less" + }, + "4": { + "name": "meta.property-value.less" + } + }, + "match": "(((\\+_?)?):)([\\s\\t]*)" + }, + { + "include": "#property-values" + }, + { + "match": "-?(?:[[_a-zA-Z][^\\x{00}-\\x{9f}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[-\\w][^\\x{00}-\\x{9f}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*(\\s+-?(?:[[_a-zA-Z][^\\x{00}-\\x{9f}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[-\\w][^\\x{00}-\\x{9f}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*)*", + "name": "string.unquoted.less" + }, + { + "match": ",", + "name": "punctuation.separator.less" + } + ] + }, + { + "begin": "\\banimation(-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function))?\\b", + "beginCaptures": { + "0": { + "name": "support.type.property-name.less" + } + }, + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "patterns": [ + { + "begin": "(((\\+_?)?):)(?=[\\s\\t]*)", + "beginCaptures": { + "1": { + "name": "punctuation.separator.key-value.less" + } + }, + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.less" + } + }, + "contentName": "meta.property-value.less", + "end": "(?=\\s*(;)|(?=[})]))", + "patterns": [ + { + "match": "\\b(linear|ease(-in)?(-out)?|step-(start|end)|none|forwards|backwards|both|normal|alternate(-reverse)?|reverse|running|paused)\\b", + "name": "support.constant.property-value.less" + }, + { + "include": "#cubic-bezier-function" + }, + { + "include": "#steps-function" + }, + { + "include": "#time-type" + }, + { + "include": "#number-type" + }, + { + "match": "-?(?:[_a-zA-Z]|[^\\x{00}-\\x{7F}]|(?:(:?\\\\[0-9a-f]{1,6}(\\r\\n|[\\s\\t\\r\\n\\f])?)|\\\\[^\\r\\n\\f0-9a-f]))(?:[-_a-zA-Z0-9]|[^\\x{00}-\\x{7F}]|(?:(:?\\\\[0-9a-f]{1,6}(\\r\\n|[\\t\\r\\n\\f])?)|\\\\[^\\r\\n\\f0-9a-f]))*", + "name": "variable.other.constant.animation-name.less" + }, + { + "include": "#literal-string" + }, + { + "include": "#property-values" + }, + { + "match": "\\s*(?:(,))" + } + ] + } + ] + }, + { + "begin": "\\b(transition(-(property|duration|delay|timing-function))?)\\b", + "beginCaptures": { + "0": { + "name": "meta.property-name.less" + }, + "1": { + "name": "support.type.property-name.less" + } + }, + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.separator.key-value.less" + }, + "4": { + "name": "meta.property-value.less" + } + }, + "match": "(((\\+_?)?):)([\\s\\t]*)" + }, + { + "include": "#time-type" + }, + { + "include": "#property-values" + }, + { + "include": "#cubic-bezier-function" + }, + { + "include": "#steps-function" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.less" + } + }, + "match": "\\s*(?:(,))" + } + ] + }, + { + "begin": "\\bfilter\\b", + "beginCaptures": { + "0": { + "name": "support.type.property-name.less" + } + }, + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "name": "meta.property-name.less", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.separator.key-value.less" + }, + "4": { + "name": "meta.property-value.less" + } + }, + "match": "(((\\+_?)?):)([\\s\\t]*)" + }, + { + "match": "\\b(inherit|initial|unset|none)\\b", + "name": "meta.property-value.less" + }, + { + "include": "#filter-functions" + } + ] + }, + { + "begin": "\\bwill-change\\b", + "beginCaptures": { + "0": { + "name": "support.type.property-name.less" + } + }, + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "name": "meta.property-name.less", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.separator.key-value.less" + }, + "4": { + "name": "meta.property-value.less" + } + }, + "match": "(((\\+_?)?):)([\\s\\t]*)" + }, + { + "match": "unset|initial|inherit|will-change|auto|scroll-position|contents", + "name": "invalid.illegal.property-value.less" + }, + { + "match": "-?(?:[[-\\w][^\\x{00}-\\x{9f}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[_a-zA-Z][^\\x{00}-\\x{9f}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*", + "name": "support.constant.property-value.less" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.less" + } + }, + "match": "\\s*(?:(,))" + } + ] + }, + { + "begin": "\\bcounter-(increment|(re)?set)\\b", + "beginCaptures": { + "0": { + "name": "support.type.property-name.less" + } + }, + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "name": "meta.property-name.less", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.separator.key-value.less" + }, + "4": { + "name": "meta.property-value.less" + } + }, + "match": "(((\\+_?)?):)([\\s\\t]*)" + }, + { + "match": "-?(?:[[-\\w][^\\x{00}-\\x{9f}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[_a-zA-Z][^\\x{00}-\\x{9f}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*", + "name": "entity.name.constant.counter-name.less" + }, + { + "include": "#integer-type" + }, + { + "match": "unset|initial|inherit|auto", + "name": "invalid.illegal.property-value.less" + } + ] + }, + { + "match": "(?x)\\b( accent-height | align-content | align-items | align-self | alignment-baseline | all | animation-timing-function | animation-play-state | animation-name | animation-iteration-count | animation-fill-mode | animation-duration | animation-direction | animation-delay | animation | appearance | ascent | azimuth | backface-visibility | background-size | background-repeat-y | background-repeat-x | background-repeat | background-position-y | background-position-x | background-position | background-origin | background-image | background-color | background-clip | background-blend-mode | background-attachment | background | baseline-shift | begin | bias | blend-mode | border-((top|right|bottom|left)-)?(width|style|color) | border-(top|bottom)-(right|left)-radius | border-image-(width|source|slice|repeat|outset) | border-(top|right|bottom|left|collapse|image|radius|spacing) | border | bottom | box-(align|decoration-break|direction|flex|ordinal-group|orient|pack|shadow|sizing) | break-(after|before|inside) | caption-side | clear | clip-path | clip-rule | clip | color(-(interpolation(-filters)?|profile|rendering))? | columns | column-(break-before|count|fill|gap|(rule(-(color|style|width))?)|span|width) | contain | content | counter-(increment|reset) | cursor | (c|d|f)(x|y) | direction | display | divisor | dominant-baseline | dur | elevation | empty-cells | enable-background | end | fallback | fill(-(opacity|rule))? | filter | flex(-(align|basis|direction|flow|grow|item-align|line-pack|negative|order|pack|positive|preferred-size|shrink|wrap))? | float | flood-(color|opacity) | font-display | font-family | font-feature-settings | font-kerning | font-language-override | font-size(-adjust)? | font-smoothing | font-stretch | font-style | font-synthesis | font-variant(-(alternates|caps|east-asian|ligatures|numeric|position))? | font-weight | font | fr | glyph-orientation-(horizontal|vertical) | grid-(area|gap) | grid-auto-(columns|flow|rows) | grid-(column|row)(-(end|gap|start))? | grid-template(-(areas|columns|rows))? | height | hyphens | image-(orientation|rendering|resolution) | isolation | justify-content | kerning | left | letter-spacing | lighting-color | line-(box-contain|break|clamp|height) | list-style(-(image|position|type))? | margin(-(bottom|left|right|top))? | marker(-(end|mid|start))? | mask(-(clip||composite|image|origin|position|repeat|size|type))? | (max|min)-(height|width) | mix-blend-mode | nbsp-mode | negative | object-(fit|position) | opacity | operator | order | orphans | outline(-(color|offset|style|width))? | overflow(-(scrolling|wrap|x|y))? | pad(ding(-(bottom|left|right|top))?)? | page(-break-(after|before|inside))? | paint-order | pause(-(after|before))? | perspective(-origin(-(x|y))?)? | pitch(-range)? | pointer-events | position | prefix | quotes | range | resize | right | rotate | scale | scroll-behavior | shape-(image-threshold|margin|outside|rendering) | size | speak(-as)? | src | stop-(color|opacity) | stroke(-(dash(array|offset)|line(cap|join)|miterlimit|opacity|width))? | suffix | symbols | system | tab-size | table-layout | tap-highlight-color | text-align(-last)? | text-decoration(-(color|line|style))? | text-emphasis(-(color|position|style))? | text-(anchor|fill-color|height|indent|justify|orientation|overflow|rendering|shadow|transform|underline-position) | top | touch-action | transform(-origin(-(x|y))?) | transform(-style)? | transition(-(delay|duration|property|timing-function))? | translate | unicode-(bidi|range) | user-(drag|select) | vertical-align | visibility | white-space | widows | width | will-change | word-(break|spacing|wrap) | writing-mode | z-index | zoom )\\b", + "name": "support.type.property-name.less" + }, + { + "include": "$self" + } + ] + }, + { + "begin": "\\b(((\\+_?)?):)([\\s\\t]*)", + "captures": { + "1": { + "name": "punctuation.separator.key-value.less" + }, + "4": { + "name": "meta.property-value.less" + } + }, + "contentName": "meta.property-value.less", + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "patterns": [ + { + "include": "#property-values" + } + ] }, { "include": "$self" } ] }, - "less_builtin_functions": { - "match": "\\b(abs|acos|alpha|argb|asin|atan|average|blue|calc|ceil|color|contrast|convert|convert|cos|darken|data-uri|desaturate|difference|e|escape|exclusion|extract|fade|fadein|fadeout|floor|format|green|greyscale|hardlight|hsl|hsla|hsv|hsva|hsvhue|hsvsaturation|hsvvalue|hue|length|lighten|lightness|luma|max|min|mix|mod|multiply|negation|overlay|percentage|pi|pow|red|replace|round|saturate|saturation|screen|sin|softlight|spin|sqrt|tan|unit)\\b", - "name": "support.function.any-method.builtin.less" + "selector": { + "patterns": [ + { + "begin": "(?=[>~+/\\.*#a-zA-Z\\[&]|(\\:{1,2}[^\\s])|@\\{)", + "contentName": "meta.selector.less", + "end": "(?=@(?!\\{)|[{;])", + "patterns": [ + { + "include": "#comment-line" + }, + { + "include": "#selectors" + }, + { + "include": "#less-namespace-accessors" + }, + { + "include": "#less-variable-interpolation" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.less" + } + }, + "match": "(\\!)\\s*important", + "name": "keyword.other.important.less" + } + ] + } + ] + }, + "selectors": { + "patterns": [ + { + "match": "\\b([a-z](?:(?:[-_a-z0-9\\x{00B7}]|\\\\\\.|[[\\x{00C0}-\\x{00D6}][\\x{00D8}-\\x{00F6}][\\x{00F8}-\\x{02FF}][\\x{0300}-\\x{037D}][\\x{037F}-\\x{1FFF}][\\x{200C}-\\x{200D}][\\x{203F}-\\x{2040}][\\x{2070}-\\x{218F}][\\x{2C00}-\\x{2FEF}][\\x{3001}-\\x{D7FF}][\\x{F900}-\\x{FDCF}][\\x{FDF0}-\\x{FFFD}][\\x{10000}-\\x{EFFFF}]]))*-(?:(?:[-_a-z0-9\\x{00B7}]|\\\\\\.|[[\\x{00C0}-\\x{00D6}][\\x{00D8}-\\x{00F6}][\\x{00F8}-\\x{02FF}][\\x{0300}-\\x{037D}][\\x{037F}-\\x{1FFF}][\\x{200C}-\\x{200D}][\\x{203F}-\\x{2040}][\\x{2070}-\\x{218F}][\\x{2C00}-\\x{2FEF}][\\x{3001}-\\x{D7FF}][\\x{F900}-\\x{FDCF}][\\x{FDF0}-\\x{FFFD}][\\x{10000}-\\x{EFFFF}]]))*)\\b", + "name": "entity.name.tag.custom.less" + }, + { + "match": "(?x)\\b( a | abbr | acronym | address | applet | area | article | aside | audio | b | base | basefont | bdi | bdo | big | blockquote | body | br | button | canvas | caption | circle | cite | clipPath | code | col | colgroup | content | data | dataList | dd | defs | del | details | dfn | dialog | dir | div | dl | dt | element | ellipse | em | embed | eventsource | fieldset | figcaption | figure | filter | footer | foreignObject | form | frame | frameset | g | glyph | glyphRef | h1 | h2 | h3 | h4 | h5 | h6 | head | header | hgroup | hr | html | i | iframe | image | img | input | ins | isindex | kbd | keygen | label | legend | li | line | linearGradient | link | main | map | mark | marker | mask | menu | meta | meter | nav | noframes | noscript | object | ol | optgroup | option | output | p | param | path | pattern | picture | polygon | polyline | pre | progress | q | radialGradient | rect | rp | ruby | rt | rtc | s | samp | script | section | select | shadow | small | source | span | stop | strike | strong | style | sub | summary | sup | svg | switch | symbol | table | tbody | td | template | textarea | textPath | tfoot | th | thead | time | title | tr | track | tref | tspan | tt | u | ul | use | var | video | wbr | xmp )\\b", + "name": "entity.name.tag.less" + }, + { + "begin": "(\\.)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.entity.less" + } + }, + "end": "(?![-\\w]|[^\\x{00}-\\x{9f}]|\\\\([A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9])|(\\@(?=\\{)))", + "name": "entity.other.attribute-name.class.less", + "patterns": [ + { + "include": "#less-variable-interpolation" + } + ] + }, + { + "begin": "(#)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.entity.less" + } + }, + "end": "(?![-\\w]|[^\\x{00}-\\x{9f}]|\\\\([A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9])|(\\@(?=\\{)))", + "name": "entity.other.attribute-name.id.less", + "patterns": [ + { + "include": "#less-variable-interpolation" + } + ] + }, + { + "begin": "(&)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.entity.less" + } + }, + "contentName": "entity.other.attribute-name.parent.less", + "end": "(?![-\\w]|[^\\x{00}-\\x{9f}]|\\\\([A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9])|(\\@(?=\\{)))", + "name": "entity.other.attribute-name.parent.less", + "patterns": [ + { + "include": "#less-variable-interpolation" + }, + { + "include": "#selectors" + } + ] + }, + { + "include": "#pseudo-elements" + }, + { + "include": "#pseudo-classes" + }, + { + "include": "#less-extend" + }, + { + "match": "(?!\\+_?:)(?:>{1,3}|[~+])(?![>~+;}])", + "name": "punctuation.separator.combinator.less" + }, + { + "match": "((?:>{1,3}|[~+])){2,}", + "name": "invalid.illegal.combinator.less" + }, + { + "match": "\\/deep\\/", + "name": "invalid.illegal.combinator.less" + }, + { + "begin": "\\[", + "captures": { + "0": { + "name": "punctuation.definition.entity.less" + } + }, + "end": "\\]", + "name": "meta.attribute-selector.less", + "patterns": [ + { + "include": "#less-variable-interpolation" + }, + { + "include": "#qualified-name" + }, + { + "match": "(-?(?:[[_a-zA-Z][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*)", + "name": "entity.other.attribute-name.less" + }, + { + "begin": "\\s*([~*|^$]?=)\\s*", + "captures": { + "1": { + "name": "keyword.operator.attribute-selector.less" + } + }, + "end": "(?=(\\s|\\]))", + "patterns": [ + { + "include": "#less-variable-interpolation" + }, + { + "match": "[^\\s\\]\\['\"]", + "name": "string.unquoted.less" + }, + { + "include": "#literal-string" + }, + { + "captures": { + "1": { + "name": "keyword.other.less" + } + }, + "match": "(?:\\s+([iI]))?" + }, + { + "match": "\\]", + "name": "punctuation.definition.entity.less" + } + ] + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.less" + } + }, + "match": "\\s*(?:(,))" + }, + { + "match": "\\*", + "name": "entity.name.tag.wildcard.less" + } + ] + }, + "shape-functions": { + "patterns": [ + { + "begin": "\\b(rect)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.shape.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "match": "\\bauto\\b", + "name": "support.constant.property-value.less" + }, + { + "include": "#length-type" + }, + { + "include": "#comma-delimiter" + } + ] + } + ] + }, + { + "begin": "\\b(inset)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.shape.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "match": "\\bround\\b", + "name": "keyword.other.less" + }, + { + "include": "#length-type" + }, + { + "include": "#percentage-type" + } + ] + } + ] + }, + { + "begin": "\\b(circle|ellipse)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.shape.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "match": "\\bat\\b", + "name": "keyword.other.less" + }, + { + "match": "\\b(top|right|bottom|left|center|closest-side|farthest-side)\\b", + "name": "support.constant.property-value.less" + }, + { + "include": "#length-type" + }, + { + "include": "#percentage-type" + } + ] + } + ] + }, + { + "begin": "\\b(polygon)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.shape.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "match": "\\b(nonzero|evenodd)\\b", + "name": "support.constant.property-value.less" + }, + { + "include": "#length-type" + }, + { + "include": "#percentage-type" + } + ] + } + ] + } + ] + }, + "steps-function": { + "begin": "\\b(steps)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.timing.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#comma-delimiter" + }, + { + "include": "#integer-type" + }, + { + "match": "(end|middle|start)", + "name": "support.keyword.timing-direction.less" + } + ] + } + ] + }, + "string-content": { + "patterns": [ + { + "include": "#less-variable-interpolation" + }, + { + "match": "\\\\\\s*\\n", + "name": "constant.character.escape.newline.less" + }, + { + "match": "\\\\(\\h{1,6}|.)", + "name": "constant.character.escape.less" + } + ] + }, + "symbols-function": { + "begin": "\\b(symbols)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.counter.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "match": "\\b(cyclic|numeric|alphabetic|symbolic|fixed)\\b", + "name": "support.constant.symbol-type.less" + }, + { + "include": "#comma-delimiter" + }, + { + "include": "#literal-string" + }, + { + "include": "#image-type" + } + ] + } + ] + }, + "time-type": { + "captures": { + "1": { + "name": "keyword.other.unit.less" + } + }, + "match": "(?i:[-+]?(?:(?:\\d*\\.\\d+(?:[eE](?:[-+]?\\d+))*)|(?:[-+]?\\d+))(s|ms))\\b", + "name": "constant.numeric.less" + }, + "transform-functions": { + "patterns": [ + { + "begin": "\\b(matrix3d|scale3d|matrix|scale)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.transform.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#comma-delimiter" + }, + { + "include": "#number-type" + }, + { + "include": "#less-variables" + }, + { + "include": "#var-function" + } + ] + } + ] + }, + { + "begin": "\\b(translate(3d)?)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.transform.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#comma-delimiter" + }, + { + "include": "#percentage-type" + }, + { + "include": "#length-type" + }, + { + "include": "#number-type" + }, + { + "include": "#less-variables" + }, + { + "include": "#var-function" + } + ] + } + ] + }, + { + "begin": "\\b(translate[XY])(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.transform.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#percentage-type" + }, + { + "include": "#length-type" + }, + { + "include": "#number-type" + }, + { + "include": "#less-variables" + }, + { + "include": "#var-function" + } + ] + } + ] + }, + { + "begin": "\\b(rotate[XYZ]?|skew[XY])(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.transform.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#angle-type" + }, + { + "include": "#less-variables" + }, + { + "include": "#calc-function" + }, + { + "include": "#var-function" + } + ] + } + ] + }, + { + "begin": "\\b(skew)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.transform.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#comma-delimiter" + }, + { + "include": "#angle-type" + }, + { + "include": "#less-variables" + }, + { + "include": "#calc-function" + }, + { + "include": "#var-function" + } + ] + } + ] + }, + { + "begin": "\\b(translateZ|perspective)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.transform.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#length-type" + }, + { + "include": "#less-variables" + }, + { + "include": "#calc-function" + }, + { + "include": "#var-function" + } + ] + } + ] + }, + { + "begin": "\\b(rotate3d)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.transform.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#comma-delimiter" + }, + { + "include": "#angle-type" + }, + { + "include": "#number-type" + }, + { + "include": "#less-variables" + }, + { + "include": "#calc-function" + }, + { + "include": "#var-function" + } + ] + } + ] + }, + { + "begin": "\\b(scale[XYZ])(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.transform.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#comma-delimiter" + }, + { + "include": "#number-type" + }, + { + "include": "#less-variables" + }, + { + "include": "#calc-function" + }, + { + "include": "#var-function" + } + ] + } + ] + } + ] + }, + "unicode-range": { + "captures": { + "1": { + "name": "support.constant.unicode-range.prefix.less" + }, + "2": { + "name": "constant.codepoint-range.less" + }, + "3": { + "name": "punctuation.section.range.less" + } + }, + "match": "(?i)(u\\+)([0-9a-f?]{1,6}(?:(-)[0-9a-f]{1,6})?)", + "name": "support.unicode-range.less" + }, + "unquoted-string": { + "match": "[^\\s'\"]", + "name": "string.unquoted.less" + }, + "url-function": { + "begin": "\\b(url)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.url.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#literal-string" + }, + { + "include": "#unquoted-string" + }, + { + "include": "#var-function" + } + ] + } + ] + }, + "var-function": { + "patterns": [ + { + "begin": "\\b(var)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.var.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#comma-delimiter" + }, + { + "include": "#custom-property-name" + }, + { + "include": "#less-variables" + } + ] + } + ] + } + ] + }, + "vendor-prefix": { + "match": "-(?:webkit|moz(-osx)?|ms|o)-", + "name": "support.type.vendor-prefix.less" } } } \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/log/cgmanifest.json b/plugins/textmate/lib/bundles/log/cgmanifest.json deleted file mode 100644 index 7d7c9466d70d..000000000000 --- a/plugins/textmate/lib/bundles/log/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "vscode-logfile-highlighter", - "repositoryUrl": "https://github.com/emilast/vscode-logfile-highlighter", - "commitHash": "8acba9307254d1887ac770057767698c82d926c6" - } - }, - "license": "MIT", - "version": "2.15.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/log/syntaxes/log.tmLanguage.json b/plugins/textmate/lib/bundles/log/syntaxes/log.tmLanguage.json index 8b6bd8ce8b38..5cea098004b5 100644 --- a/plugins/textmate/lib/bundles/log/syntaxes/log.tmLanguage.json +++ b/plugins/textmate/lib/bundles/log/syntaxes/log.tmLanguage.json @@ -4,7 +4,7 @@ "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/emilast/vscode-logfile-highlighter/commit/8acba9307254d1887ac770057767698c82d926c6", + "version": "https://github.com/emilast/vscode-logfile-highlighter/commit/eb50e785c27b4b4f7dbf6c0e801c58fe91baef5d", "name": "Log file", "scopeName": "text.log", "patterns": [ @@ -113,7 +113,7 @@ "name": "string.regexp, emphasis log.exceptiontype" }, { - "begin": "^[\\t ]*at", + "begin": "^[\\t ]*at[\\t ]", "end": "$", "name": "string.key, emphasis log.exception" }, diff --git a/plugins/textmate/lib/bundles/lua/cgmanifest.json b/plugins/textmate/lib/bundles/lua/cgmanifest.json deleted file mode 100644 index 0721cb91aceb..000000000000 --- a/plugins/textmate/lib/bundles/lua/cgmanifest.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "sumneko/lua.tmbundle", - "repositoryUrl": "https://github.com/sumneko/lua.tmbundle", - "commitHash": "3a18700941737c3ab66ac5964696f141aee61800" - } - }, - "licenseDetail": [ - "Copyright (c) sumneko-lua.tmbundle project authors", - "", - "If not otherwise specified (see below), files in this repository fall under the following license:", - "", - "Permission to copy, use, modify, sell and distribute this", - "software is granted. This software is provided \"as is\" without", - "express or implied warranty, and with no claim as to its", - "suitability for any purpose.", - "", - "An exception is made for files in readable text which contain their own license information,", - "or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added", - "to the base-name name of the original file, and an extension of txt, html, or similar. For example", - "\"tidy\" is accompanied by \"tidy-license.txt\"." - ], - "license": "TextMate Bundle License", - "version": "1.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/lua/syntaxes/lua.tmLanguage.json b/plugins/textmate/lib/bundles/lua/syntaxes/lua.tmLanguage.json index c28465b5ce63..e578b8846cba 100644 --- a/plugins/textmate/lib/bundles/lua/syntaxes/lua.tmLanguage.json +++ b/plugins/textmate/lib/bundles/lua/syntaxes/lua.tmLanguage.json @@ -4,7 +4,7 @@ "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/sumneko/lua.tmbundle/commit/3a18700941737c3ab66ac5964696f141aee61800", + "version": "https://github.com/sumneko/lua.tmbundle/commit/94ce82cc4d45f82641a5252d7a7fd9e28c875adc", "name": "Lua", "scopeName": "source.lua", "patterns": [ @@ -356,6 +356,26 @@ } }, "patterns": [ + { + "begin": "--\\[(=*)\\[@@@", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.lua" + } + }, + "end": "\\]\\1\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.lua" + } + }, + "name": "", + "patterns": [ + { + "include": "source.lua" + } + ] + }, { "begin": "--\\[(=*)\\[", "beginCaptures": { @@ -928,7 +948,6 @@ }, "ldoc_tag": { "match": "\\G[ \\t]*(@)(alias|annotation|author|charset|class|classmod|comment|constructor|copyright|description|example|export|factory|field|file|fixme|function|include|lfunction|license|local|module|name|param|pragma|private|raise|release|return|script|section|see|set|static|submodule|summary|tfield|thread|tparam|treturn|todo|topic|type|usage|warning|within)\\b", - "end": "(?!@)\\b", "captures": { "1": { "name": "punctuation.definition.block.tag.ldoc" diff --git a/plugins/textmate/lib/bundles/make/cgmanifest.json b/plugins/textmate/lib/bundles/make/cgmanifest.json deleted file mode 100644 index 6548e081a2b0..000000000000 --- a/plugins/textmate/lib/bundles/make/cgmanifest.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "fadeevab/make.tmbundle", - "repositoryUrl": "https://github.com/fadeevab/make.tmbundle", - "commitHash": "1d4c0b541959995db098df751ffc129da39a294b" - } - }, - "licenseDetail": [ - "Copyright (c) textmate-make.tmbundle project authors", - "", - "If not otherwise specified (see below), files in this repository fall under the following license:", - "", - "Permission to copy, use, modify, sell and distribute this", - "software is granted. This software is provided \"as is\" without", - "express or implied warranty, and with no claim as to its", - "suitability for any purpose.", - "", - "An exception is made for files in readable text which contain their own license information,", - "or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added", - "to the base-name name of the original file, and an extension of txt, html, or similar. For example", - "\"tidy\" is accompanied by \"tidy-license.txt\"." - ], - "license": "TextMate Bundle License", - "version": "0.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/markdown-basics/cgmanifest.json b/plugins/textmate/lib/bundles/markdown-basics/cgmanifest.json deleted file mode 100644 index 8dcb43d123f6..000000000000 --- a/plugins/textmate/lib/bundles/markdown-basics/cgmanifest.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "textmate/markdown.tmbundle", - "repositoryUrl": "https://github.com/textmate/markdown.tmbundle", - "commitHash": "11cf764606cb2cde54badb5d0e5a0758a8871c4b" - } - }, - "licenseDetail": [ - "Copyright (c) markdown.tmbundle authors", - "", - "If not otherwise specified (see below), files in this repository fall under the following license:", - "", - "Permission to copy, use, modify, sell and distribute this", - "software is granted. This software is provided \"as is\" without", - "express or implied warranty, and with no claim as to its", - "suitability for any purpose.", - "", - "An exception is made for files in readable text which contain their own license information,", - "or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added", - "to the base-name name of the original file, and an extension of txt, html, or similar. For example", - "\"tidy\" is accompanied by \"tidy-license.txt\"." - ], - "license": "TextMate Bundle License", - "version": "0.0.0" - }, - { - "component": { - "type": "git", - "git": { - "name": "microsoft/vscode-markdown-tm-grammar", - "repositoryUrl": "https://github.com/microsoft/vscode-markdown-tm-grammar", - "commitHash": "0a4b23580308fdcfb4ab7b526e3e13ba17d436fb" - } - }, - "license": "MIT", - "version": "1.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/markdown-basics/language-configuration.json b/plugins/textmate/lib/bundles/markdown-basics/language-configuration.json index 40f4be77c1d8..f1e7859ccca5 100644 --- a/plugins/textmate/lib/bundles/markdown-basics/language-configuration.json +++ b/plugins/textmate/lib/bundles/markdown-basics/language-configuration.json @@ -42,14 +42,6 @@ "string" ] }, - { - "open": "`", - "close": "`" - }, - { - "open": "```", - "close": "```" - }, ], "surroundingPairs": [ [ @@ -83,6 +75,10 @@ [ "\"", "\"" + ], + [ + "<", + ">" ] ], "folding": { diff --git a/plugins/textmate/lib/bundles/markdown-basics/syntaxes/markdown.tmLanguage.json b/plugins/textmate/lib/bundles/markdown-basics/syntaxes/markdown.tmLanguage.json index 3f96e33b0107..b5472c56cfda 100644 --- a/plugins/textmate/lib/bundles/markdown-basics/syntaxes/markdown.tmLanguage.json +++ b/plugins/textmate/lib/bundles/markdown-basics/syntaxes/markdown.tmLanguage.json @@ -4,7 +4,7 @@ "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/microsoft/vscode-markdown-tm-grammar/commit/0a4b23580308fdcfb4ab7b526e3e13ba17d436fb", + "version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/0b36cbbf917fb0188e1a1bafc8287c7abf8b0b37", "name": "Markdown", "scopeName": "text.html.markdown", "patterns": [ @@ -2255,12 +2255,7 @@ ] } }, - "name": "markup.heading.markdown", - "patterns": [ - { - "include": "#inline" - } - ] + "name": "markup.heading.markdown" }, "heading-setext": { "patterns": [ diff --git a/plugins/textmate/lib/bundles/markdown-math/cgmanifest.json b/plugins/textmate/lib/bundles/markdown-math/cgmanifest.json deleted file mode 100644 index 491c15548785..000000000000 --- a/plugins/textmate/lib/bundles/markdown-math/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "James-Yu/LaTeX-Workshop", - "repositoryUrl": "https://github.com/James-Yu/LaTeX-Workshop", - "commitHash": "e4cd86f1731546c2cdde0cc93717ca3fec2da0ba" - } - }, - "license": "MIT", - "version": "8.19.1" - } - ], - "version": 1 -} diff --git a/plugins/textmate/lib/bundles/objective-c/cgmanifest.json b/plugins/textmate/lib/bundles/objective-c/cgmanifest.json deleted file mode 100644 index 597202cd818d..000000000000 --- a/plugins/textmate/lib/bundles/objective-c/cgmanifest.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "jeff-hykin/better-objcpp-syntax", - "repositoryUrl": "https://github.com/jeff-hykin/better-objcpp-syntax", - "commitHash": "5a7eb15eee382dd5aa388bc04fdb60a0d2128e14" - } - }, - "license": "MIT", - "version": "0.1.0", - "description": "The files syntaxes/objective-c.tmLanguage.json and syntaxes/objective-c++.tmLanguage.json were derived from the language package https://github.com/jeff-hykin/cpp-textmate-grammar." - }, - { - "component": { - "type": "git", - "git": { - "name": "jeff-hykin/better-objc-syntax", - "repositoryUrl": "https://github.com/jeff-hykin/better-objc-syntax", - "commitHash": "119b75fb1f4d3e8726fa62588e3b935e0b719294" - } - }, - "license": "MIT", - "version": "0.2.0", - "description": "The files syntaxes/objective-c.tmLanguage.json and syntaxes/objective-c++.tmLanguage.json were derived from the language package https://github.com/jeff-hykin/cpp-textmate-grammar." - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/perl/cgmanifest.json b/plugins/textmate/lib/bundles/perl/cgmanifest.json deleted file mode 100644 index cd175abe37de..000000000000 --- a/plugins/textmate/lib/bundles/perl/cgmanifest.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "textmate/perl.tmbundle", - "repositoryUrl": "https://github.com/textmate/perl.tmbundle", - "commitHash": "a85927a902d6e5d7805f56a653f324d34dfad53a" - } - }, - "licenseDetail": [ - "Copyright (c) textmate-perl.tmbundle project authors", - "", - "If not otherwise specified (see below), files in this repository fall under the following license:", - "", - "Permission to copy, use, modify, sell and distribute this", - "software is granted. This software is provided \"as is\" without", - "express or implied warranty, and with no claim as to its", - "suitability for any purpose.", - "", - "An exception is made for files in readable text which contain their own license information,", - "or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added", - "to the base-name name of the original file, and an extension of txt, html, or similar. For example", - "\"tidy\" is accompanied by \"tidy-license.txt\"." - ], - "license": "TextMate Bundle License", - "description": "The files syntaxes/perl.tmLanguage.json and syntaxes/perl6.tmLanguage.json were derived from Perl.plist and Perl 6.tmLanguage from https://github.com/textmate/perl.tmbundle.", - "version": "0.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/php/cgmanifest.json b/plugins/textmate/lib/bundles/php/cgmanifest.json deleted file mode 100644 index 02faac2b0c03..000000000000 --- a/plugins/textmate/lib/bundles/php/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "language-php", - "repositoryUrl": "https://github.com/KapitanOczywisty/language-php", - "commitHash": "5e8f000cb5a20f44f7a7a89d07ad0774031c53f3" - } - }, - "license": "MIT", - "version": "0.49.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/powershell/cgmanifest.json b/plugins/textmate/lib/bundles/powershell/cgmanifest.json deleted file mode 100644 index 61f29281a5e8..000000000000 --- a/plugins/textmate/lib/bundles/powershell/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "PowerShell/EditorSyntax", - "repositoryUrl": "https://github.com/PowerShell/EditorSyntax", - "commitHash": "742f0b5d4b60f5930c0b47fcc1f646860521296e" - } - }, - "license": "MIT", - "version": "1.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/pug/cgmanifest.json b/plugins/textmate/lib/bundles/pug/cgmanifest.json deleted file mode 100644 index d0e3c6185ce1..000000000000 --- a/plugins/textmate/lib/bundles/pug/cgmanifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "davidrios/pug-tmbundle", - "repositoryUrl": "https://github.com/davidrios/pug-tmbundle", - "commitHash": "ae1dd60ca4aa4b45617f236d584216cd8d19eecf" - } - }, - "license": "MIT", - "description": "The file syntaxes/pug.tmLanguage.json was derived from Syntaxes/Pug.JSON-tmLanguage in https://github.com/davidrios/pug-tmbundle.", - "version": "0.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/python/cgmanifest.json b/plugins/textmate/lib/bundles/python/cgmanifest.json deleted file mode 100644 index ace7056c9952..000000000000 --- a/plugins/textmate/lib/bundles/python/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "MagicStack/MagicPython", - "repositoryUrl": "https://github.com/MagicStack/MagicPython", - "commitHash": "7d0f2b22a5ad8fccbd7341bc7b7a715169283044" - } - }, - "license": "MIT", - "version": "1.1.1" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/r/cgmanifest.json b/plugins/textmate/lib/bundles/r/cgmanifest.json deleted file mode 100644 index b1ccd271d818..000000000000 --- a/plugins/textmate/lib/bundles/r/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "REditorSupport/vscode-R", - "repositoryUrl": "https://github.com/REditorSupport/vscode-R", - "commitHash": "ad966f3b2de8a83594f90aa5b51f5b569cf02c08" - } - }, - "license": "MIT", - "version": "2.8.1" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/r/syntaxes/r.tmLanguage.json b/plugins/textmate/lib/bundles/r/syntaxes/r.tmLanguage.json index 88de4fd07d97..d50ab5b6d78f 100644 --- a/plugins/textmate/lib/bundles/r/syntaxes/r.tmLanguage.json +++ b/plugins/textmate/lib/bundles/r/syntaxes/r.tmLanguage.json @@ -639,4 +639,4 @@ ] } } -} +} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/razor/cgmanifest.json b/plugins/textmate/lib/bundles/razor/cgmanifest.json deleted file mode 100644 index 799e12cf3252..000000000000 --- a/plugins/textmate/lib/bundles/razor/cgmanifest.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "dotnet/razor", - "repositoryUrl": "https://github.com/dotnet/razor", - "commitHash": "69f60231df08319b544d3d32a588575acbb58ff0" - } - }, - "license": "MIT", - "version": "1.0.0", - "licenseDetail": [ - "MIT License", - "", - "Copyright (c) .NET Foundation and Contributors", - "All Rights Reserved", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and associated documentation files (the \"Software\"), to deal", - "in the Software without restriction, including without limitation the rights", - "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", - "copies of the Software, and to permit persons to whom the Software is", - "furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in all", - "copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", - "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", - "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", - "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", - "SOFTWARE." - ] - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/razor/syntaxes/cshtml.tmLanguage.json b/plugins/textmate/lib/bundles/razor/syntaxes/cshtml.tmLanguage.json index 0b5463ee3ca2..389a6daf249e 100644 --- a/plugins/textmate/lib/bundles/razor/syntaxes/cshtml.tmLanguage.json +++ b/plugins/textmate/lib/bundles/razor/syntaxes/cshtml.tmLanguage.json @@ -1,10 +1,10 @@ { "information_for_contributors": [ - "This file has been converted from https://github.com/dotnet/razor/blob/master/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode.Extension/syntaxes/aspnetcorerazor.tmLanguage.json", + "This file has been converted from https://github.com/dotnet/razor/blob/master/src/Razor/src/Microsoft.VisualStudio.RazorExtension/EmbeddedGrammars/aspnetcorerazor.tmLanguage.json", "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/dotnet/razor/commit/69f60231df08319b544d3d32a588575acbb58ff0", + "version": "https://github.com/dotnet/razor/commit/f01e110af179981942987384d2b5d4e489eab014", "name": "ASP.NET Razor", "scopeName": "text.html.cshtml", "patterns": [ @@ -527,6 +527,15 @@ }, { "include": "#using-directive" + }, + { + "include": "#rendermode-directive" + }, + { + "include": "#preservewhitespace-directive" + }, + { + "include": "#typeparam-directive" } ] }, @@ -851,6 +860,75 @@ } } }, + "rendermode-directive": { + "name": "meta.directive", + "match": "(@)(rendermode)\\s+([^$]+)?", + "captures": { + "1": { + "patterns": [ + { + "include": "#transition" + } + ] + }, + "2": { + "name": "keyword.control.razor.directive.rendermode" + }, + "3": { + "patterns": [ + { + "include": "source.cs#type" + } + ] + } + } + }, + "preservewhitespace-directive": { + "name": "meta.directive", + "match": "(@)(preservewhitespace)\\s+([^$]+)?", + "captures": { + "1": { + "patterns": [ + { + "include": "#transition" + } + ] + }, + "2": { + "name": "keyword.control.razor.directive.preservewhitespace" + }, + "3": { + "patterns": [ + { + "include": "source.cs#boolean-literal" + } + ] + } + } + }, + "typeparam-directive": { + "name": "meta.directive", + "match": "(@)(typeparam)\\s+([^$]+)?", + "captures": { + "1": { + "patterns": [ + { + "include": "#transition" + } + ] + }, + "2": { + "name": "keyword.control.razor.directive.typeparam" + }, + "3": { + "patterns": [ + { + "include": "source.cs#type" + } + ] + } + } + }, "attribute-directive": { "name": "meta.directive", "begin": "(@)(attribute)\\b\\s+", diff --git a/plugins/textmate/lib/bundles/restructuredtext/cgmanifest.json b/plugins/textmate/lib/bundles/restructuredtext/cgmanifest.json deleted file mode 100644 index 8c5f16ae613e..000000000000 --- a/plugins/textmate/lib/bundles/restructuredtext/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "trond-snekvik/vscode-rst", - "repositoryUrl": "https://github.com/trond-snekvik/vscode-rst", - "commitHash": "7f2d6bb4e20642b60f2979afcb594cfe4b48117a" - } - }, - "license": "MIT", - "version": "1.5.3" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/ruby/cgmanifest.json b/plugins/textmate/lib/bundles/ruby/cgmanifest.json deleted file mode 100644 index 2cd9595e4e53..000000000000 --- a/plugins/textmate/lib/bundles/ruby/cgmanifest.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "textmate/ruby.tmbundle", - "repositoryUrl": "https://github.com/textmate/ruby.tmbundle", - "commitHash": "efcb8941c701343f1b2e9fb105c678152fea6892" - } - }, - "licenseDetail": [ - "Copyright (c) textmate-ruby.tmbundle project authors", - "", - "If not otherwise specified (see below), files in this folder fall under the following license: ", - "", - "Permission to copy, use, modify, sell and distribute this", - "software is granted. This software is provided \"as is\" without", - "express or implied warranty, and with no claim as to its", - "suitability for any purpose.", - "", - "An exception is made for files in readable text which contain their own license information, ", - "or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added ", - "to the base-name name of the original file, and an extension of txt, html, or similar. For example ", - "\"tidy\" is accompanied by \"tidy-license.txt\"." - ], - "license": "TextMate Bundle License", - "version": "0.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/ruby/language-configuration.json b/plugins/textmate/lib/bundles/ruby/language-configuration.json index a86f592e3bdb..e1125e0bf2b8 100644 --- a/plugins/textmate/lib/bundles/ruby/language-configuration.json +++ b/plugins/textmate/lib/bundles/ruby/language-configuration.json @@ -26,6 +26,6 @@ ], "indentationRules": { "increaseIndentPattern": "^\\s*((begin|class|(private|protected)\\s+def|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|in|while|case)|([^#]*\\sdo\\b)|([^#]*=\\s*(case|if|unless)))\\b([^#\\{;]|(\"|'|\/).*\\4)*(#.*)?$", - "decreaseIndentPattern": "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif|when|in)\\b)" + "decreaseIndentPattern": "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif)\\b|(in|when)\\s)" } } diff --git a/plugins/textmate/lib/bundles/rust/cgmanifest.json b/plugins/textmate/lib/bundles/rust/cgmanifest.json deleted file mode 100644 index 512dc80a65bb..000000000000 --- a/plugins/textmate/lib/bundles/rust/cgmanifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "rust-syntax", - "repositoryUrl": "https://github.com/dustypomerleau/rust-syntax", - "commitHash": "328a68299533bc2b8c71028be741cce78a9e0d53" - } - }, - "license": "MIT", - "description": "A TextMate-style grammar for Rust.", - "version": "0.6.1" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/rust/syntaxes/rust.tmLanguage.json b/plugins/textmate/lib/bundles/rust/syntaxes/rust.tmLanguage.json index 8fcbdc5082f2..075400eb958c 100644 --- a/plugins/textmate/lib/bundles/rust/syntaxes/rust.tmLanguage.json +++ b/plugins/textmate/lib/bundles/rust/syntaxes/rust.tmLanguage.json @@ -4,7 +4,7 @@ "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/dustypomerleau/rust-syntax/commit/328a68299533bc2b8c71028be741cce78a9e0d53", + "version": "https://github.com/dustypomerleau/rust-syntax/commit/ffa06ae9d52ea5464d3047cdbdc6bb970a665d23", "name": "Rust", "scopeName": "source.rust", "patterns": [ @@ -119,54 +119,6 @@ } } }, - { - "comment": "attributes", - "name": "meta.attribute.rust", - "begin": "(#)(\\!?)(\\[)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.attribute.rust" - }, - "2": { - "name": "keyword.operator.attribute.inner.rust" - }, - "3": { - "name": "punctuation.brackets.attribute.rust" - } - }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.brackets.attribute.rust" - } - }, - "patterns": [ - { - "include": "#block-comments" - }, - { - "include": "#comments" - }, - { - "include": "#keywords" - }, - { - "include": "#lifetimes" - }, - { - "include": "#punctuation" - }, - { - "include": "#strings" - }, - { - "include": "#gtypes" - }, - { - "include": "#types" - } - ] - }, { "comment": "modules", "match": "(mod)\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][A-Za-z0-9_]*)", @@ -257,6 +209,9 @@ { "include": "#comments" }, + { + "include": "#attributes" + }, { "include": "#lvariables" }, @@ -300,12 +255,22 @@ { "comment": "documentation comments", "name": "comment.line.documentation.rust", - "match": "^\\s*///.*" + "match": "(///).*$", + "captures": { + "1": { + "name": "punctuation.definition.comment.rust" + } + } }, { "comment": "line comments", "name": "comment.line.double-slash.rust", - "match": "\\s*//.*" + "match": "(//).*$", + "captures": { + "1": { + "name": "punctuation.definition.comment.rust" + } + } } ] }, @@ -421,7 +386,7 @@ "escapes": { "comment": "escapes: ASCII, byte, Unicode, quote, regex", "name": "constant.character.escape.rust", - "match": "(\\\\)(?:(?:(x[0-7][0-7a-fA-F])|(u(\\{)[\\da-fA-F]{4,6}(\\}))|.))", + "match": "(\\\\)(?:(?:(x[0-7][\\da-fA-F])|(u(\\{)[\\da-fA-F]{4,6}(\\}))|.))", "captures": { "1": { "name": "constant.character.escape.backslash.rust" @@ -440,6 +405,51 @@ } } }, + "attributes": { + "comment": "attributes", + "name": "meta.attribute.rust", + "begin": "(#)(\\!?)(\\[)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.attribute.rust" + }, + "3": { + "name": "punctuation.brackets.attribute.rust" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.brackets.attribute.rust" + } + }, + "patterns": [ + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#keywords" + }, + { + "include": "#lifetimes" + }, + { + "include": "#punctuation" + }, + { + "include": "#strings" + }, + { + "include": "#gtypes" + }, + { + "include": "#types" + } + ] + }, "functions": { "patterns": [ { @@ -548,6 +558,9 @@ { "include": "#comments" }, + { + "include": "#attributes" + }, { "include": "#keywords" }, @@ -608,6 +621,9 @@ { "include": "#comments" }, + { + "include": "#attributes" + }, { "include": "#keywords" }, @@ -913,7 +929,7 @@ }, { "comment": "parameterized types", - "begin": "\\b([A-Z][A-Za-z0-9]*)(<)", + "begin": "\\b(_?[A-Z][A-Za-z0-9_]*)(<)", "beginCaptures": { "1": { "name": "entity.name.type.rust" @@ -962,7 +978,7 @@ }, { "comment": "trait declarations", - "match": "\\b(trait)\\s+([A-Z][A-Za-z0-9]*)\\b", + "match": "\\b(trait)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b", "captures": { "1": { "name": "keyword.declaration.trait.rust storage.type.rust" @@ -974,7 +990,7 @@ }, { "comment": "struct declarations", - "match": "\\b(struct)\\s+([A-Z][A-Za-z0-9]*)\\b", + "match": "\\b(struct)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b", "captures": { "1": { "name": "keyword.declaration.struct.rust storage.type.rust" @@ -986,7 +1002,7 @@ }, { "comment": "enum declarations", - "match": "\\b(enum)\\s+([A-Z][A-Za-z0-9_]*)\\b", + "match": "\\b(enum)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b", "captures": { "1": { "name": "keyword.declaration.enum.rust storage.type.rust" @@ -998,7 +1014,7 @@ }, { "comment": "type declarations", - "match": "\\b(type)\\s+([A-Z][A-Za-z0-9_]*)\\b", + "match": "\\b(type)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b", "captures": { "1": { "name": "keyword.declaration.type.rust storage.type.rust" @@ -1011,7 +1027,7 @@ { "comment": "types", "name": "entity.name.type.rust", - "match": "\\b[A-Z][A-Za-z0-9]*\\b(?!!)" + "match": "\\b_?[A-Z][A-Za-z0-9_]*\\b(?!!)" } ] }, diff --git a/plugins/textmate/lib/bundles/scss/cgmanifest.json b/plugins/textmate/lib/bundles/scss/cgmanifest.json deleted file mode 100644 index 12247769ce22..000000000000 --- a/plugins/textmate/lib/bundles/scss/cgmanifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "atom/language-sass", - "repositoryUrl": "https://github.com/atom/language-sass", - "commitHash": "f52ab12f7f9346cc2568129d8c4419bd3d506b47" - } - }, - "license": "MIT", - "description": "The file syntaxes/scss.json was derived from the Atom package https://github.com/atom/language-sass which was originally converted from the TextMate bundle https://github.com/alexsancho/SASS.tmbundle.", - "version": "0.62.1" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/shaderlab/cgmanifest.json b/plugins/textmate/lib/bundles/shaderlab/cgmanifest.json deleted file mode 100644 index 2dd540dc872f..000000000000 --- a/plugins/textmate/lib/bundles/shaderlab/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "shaders-tmLanguage", - "repositoryUrl": "https://github.com/tgjones/shaders-tmLanguage", - "commitHash": "c72c8b39380ba5a86c58ceed053b5d965ebf38b3" - } - }, - "license": "MIT", - "version": "0.1.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/shellscript/cgmanifest.json b/plugins/textmate/lib/bundles/shellscript/cgmanifest.json deleted file mode 100644 index dbb4301b62ce..000000000000 --- a/plugins/textmate/lib/bundles/shellscript/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "jeff-hykin/better-shell-syntax", - "repositoryUrl": "https://github.com/jeff-hykin/better-shell-syntax", - "commitHash": "a3de7b32f1537194a83ee848838402fbf4b67424" - } - }, - "license": "MIT", - "version": "1.6.2" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/sql/cgmanifest.json b/plugins/textmate/lib/bundles/sql/cgmanifest.json deleted file mode 100644 index 732474f0dc5e..000000000000 --- a/plugins/textmate/lib/bundles/sql/cgmanifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "microsoft/vscode-mssql", - "repositoryUrl": "https://github.com/microsoft/vscode-mssql", - "commitHash": "9cb3529a978ddf599bf5bdd228f21bbcfe2914f5" - } - }, - "license": "MIT", - "version": "1.20.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/sql/syntaxes/sql.tmLanguage.json b/plugins/textmate/lib/bundles/sql/syntaxes/sql.tmLanguage.json index ba6fac581923..9db452210265 100644 --- a/plugins/textmate/lib/bundles/sql/syntaxes/sql.tmLanguage.json +++ b/plugins/textmate/lib/bundles/sql/syntaxes/sql.tmLanguage.json @@ -4,7 +4,7 @@ "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/microsoft/vscode-mssql/commit/9cb3529a978ddf599bf5bdd228f21bbcfe2914f5", + "version": "https://github.com/microsoft/vscode-mssql/commit/49eff02f68b6ee73025c6665c672ca1c93385dde", "name": "SQL", "scopeName": "source.sql", "patterns": [ @@ -372,7 +372,7 @@ "include": "#regexps" }, { - "match": "\\b(?i)(abort|abort_after_wait|absent|absolute|accent_sensitivity|acceptable_cursopt|acp|action|activation|add|address|admin|aes_128|aes_192|aes_256|affinity|after|aggregate|algorithm|all_constraints|all_errormsgs|all_indexes|all_levels|all_results|allow_connections|allow_dup_row|allow_encrypted_value_modifications|allow_page_locks|allow_row_locks|allow_snapshot_isolation|alter|altercolumn|always|anonymous|ansi_defaults|ansi_null_default|ansi_null_dflt_off|ansi_null_dflt_on|ansi_nulls|ansi_padding|ansi_warnings|appdomain|append|application|apply|arithabort|arithignore|array|assembly|asymmetric|asynchronous_commit|at|atan2|atomic|attach|attach_force_rebuild_log|attach_rebuild_log|audit|auth_realm|authentication|auto|auto_cleanup|auto_close|auto_create_statistics|auto_drop|auto_shrink|auto_update_statistics|auto_update_statistics_async|automated_backup_preference|automatic|autopilot|availability|availability_mode|backup|backup_priority|base64|basic|batches|batchsize|before|between|bigint|binary|binding|bit|block|blockers|blocksize|bmk|both|break|broker|broker_instance|bucket_count|buffer|buffercount|bulk_logged|by|call|caller|card|case|catalog|catch|cert|certificate|change_retention|change_tracking|change_tracking_context|changes|char|character|character_set|check_expiration|check_policy|checkconstraints|checkindex|checkpoint|checksum|cleanup_policy|clear|clear_port|close|clustered|codepage|collection|column_encryption_key|column_master_key|columnstore|columnstore_archive|colv_80_to_100|colv_100_to_80|commit_differential_base|committed|compatibility_level|compress_all_row_groups|compression|compression_delay|concat_null_yields_null|concatenate|configuration|connect|containment|continue|continue_after_error|contract|contract_name|control|conversation|conversation_group_id|conversation_handle|copy|copy_only|count_rows|counter|create(\\\\s+or\\\\s+alter)?|credential|cross|cryptographic|cryptographic_provider|cube|cursor|cursor_close_on_commit|cursor_default|data|data_compression|data_flush_interval_seconds|data_mirroring|data_purity|data_source|database|database_name|database_snapshot|datafiletype|date_correlation_optimization|date|datefirst|dateformat|date_format|datetime|datetime2|datetimeoffset|day(s)?|db_chaining|dbid|dbidexec|dbo_only|deadlock_priority|deallocate|dec|decimal|declare|decrypt|decrypt_a|decryption|default_database|default_fulltext_language|default_language|default_logon_domain|default_schema|definition|delay|delayed_durability|delimitedtext|density_vector|dependent|des|description|desired_state|desx|differential|digest|disable|disable_broker|disable_def_cnst_chk|disabled|disk|distinct|distributed|distribution|drop|drop_existing|dts_buffers|dump|durability|dynamic|edition|elements|else|emergency|empty|enable|enable_broker|enabled|encoding|encrypted|encrypted_value|encryption|encryption_type|end|endpoint|endpoint_url|enhancedintegrity|entry|error_broker_conversations|errorfile|estimateonly|event|except|exec|executable|execute|exists|expand|expiredate|expiry_date|explicit|external|external_access|failover|failover_mode|failure_condition_level|fast|fast_forward|fastfirstrow|federated_service_account|fetch|field_terminator|fieldterminator|file|filelistonly|filegroup|filegrowth|filename|filestream|filestream_log|filestream_on|filetable|file_format|filter|first_row|fips_flagger|fire_triggers|first|firstrow|float|flush_interval_seconds|fmtonly|following|for|force|force_failover_allow_data_loss|force_service_allow_data_loss|forced|forceplan|formatfile|format_options|format_type|formsof|forward_only|free_cursors|free_exec_context|fullscan|fulltext|fulltextall|fulltextkey|function|generated|get|geography|geometry|global|go|goto|governor|guid|hadoop|hardening|hash|hashed|header_limit|headeronly|health_check_timeout|hidden|hierarchyid|histogram|histogram_steps|hits_cursors|hits_exec_context|hour(s)?|http|identity|identity_value|if|ifnull|ignore|ignore_constraints|ignore_dup_key|ignore_dup_row|ignore_triggers|image|immediate|implicit_transactions|include|include_null_values|incremental|index|inflectional|init|initiator|insensitive|insert|instead|int|integer|integrated|intersect|intermediate|interval_length_minutes|into|inuse_cursors|inuse_exec_context|io|is|isabout|iso_week|isolation|job_tracker_location|json|keep|keep_nulls|keep_replication|keepdefaults|keepfixed|keepidentity|keepnulls|kerberos|key|key_path|key_source|key_store_provider_name|keyset|kill|kilobytes_per_batch|labelonly|langid|language|last|lastrow|leading|legacy_cardinality_estimation|length|level|lifetime|lineage_80_to_100|lineage_100_to_80|listener_ip|listener_port|load|loadhistory|lob_compaction|local|local_service_name|locate|location|lock_escalation|lock_timeout|lockres|log|login|login_type|loop|manual|mark_in_use_for_removal|masked|master|matched|max_queue_readers|max_duration|max_outstanding_io_per_volume|maxdop|maxerrors|maxlength|maxtransfersize|max_plans_per_query|max_storage_size_mb|mediadescription|medianame|mediapassword|memogroup|memory_optimized|merge|message|message_forward_size|message_forwarding|microsecond|millisecond|minute(s)?|mirror_address|misses_cursors|misses_exec_context|mixed|modify|money|month|move|multi_user|must_change|name|namespace|nanosecond|native|native_compilation|nchar|ncharacter|nested_triggers|never|new_account|new_broker|newname|next|no|no_browsetable|no_checksum|no_compression|no_infomsgs|no_triggers|no_truncate|nocount|noexec|noexpand|noformat|noinit|nolock|nonatomic|nonclustered|nondurable|none|norecompute|norecovery|noreset|norewind|noskip|not|notification|nounload|now|nowait|ntext|ntlm|nulls|numeric|numeric_roundabort|nvarchar|object|objid|oem|offline|old_account|online|operation_mode|open|openjson|optimistic|option|orc|out|outer|output|over|override|owner|ownership|pad_index|page|page_checksum|page_verify|pagecount|paglock|param|parameter_sniffing|parameter_type_expansion|parameterization|parquet|parseonly|partial|partition|partner|password|path|pause|percentage|permission_set|persisted|period|physical_only|plan_forcing_mode|policy|pool|population|ports|preceding|precision|predicate|presume_abort|primary|primary_role|print|prior|priority |priority_level|private|proc(edure)?|procedure_name|profile|provider|quarter|query_capture_mode|query_governor_cost_limit|query_optimizer_hotfixes|query_store|queue|quoted_identifier|raiserror|range|raw|rcfile|rc2|rc4|rc4_128|rdbms|read_committed_snapshot|read|read_only|read_write|readcommitted|readcommittedlock|readonly|readpast|readuncommitted|readwrite|real|rebuild|receive|recmodel_70backcomp|recompile|reconfigure|recovery|recursive|recursive_triggers|redo_queue|reject_sample_value|reject_type|reject_value|relative|remote|remote_data_archive|remote_proc_transactions|remote_service_name|remove|removed_cursors|removed_exec_context|reorganize|repeat|repeatable|repeatableread|replace|replica|replicated|replnick_100_to_80|replnickarray_80_to_100|replnickarray_100_to_80|required|required_cursopt|resample|reset|resource|resource_manager_location|respect|restart|restore|restricted_user|resume|retaindays|retention|return|revert|rewind|rewindonly|returns|robust|role|rollup|root|round_robin|route|row|rowdump|rowguidcol|rowlock|row_terminator|rows|rows_per_batch|rowsets_only|rowterminator|rowversion|rsa_1024|rsa_2048|rsa_3072|rsa_4096|rsa_512|safe|safety|sample|save|scalar|schema|schemabinding|scoped|scroll|scroll_locks|sddl|second|secexpr|seconds|secondary|secondary_only|secondary_role|secret|security|securityaudit|selective|self|send|sent|sequence|serde_method|serializable|server|service|service_broker|service_name|service_objective|session_timeout|session|sessions|seterror|setopts|sets|shard_map_manager|shard_map_name|sharded|shared_memory|show_statistics|showplan_all|showplan_text|showplan_xml|showplan_xml_with_recompile|shrinkdb|shutdown|sid|signature|simple|single_blob|single_clob|single_nclob|single_user|singleton|site|size|size_based_cleanup_mode|skip|smalldatetime|smallint|smallmoney|snapshot|snapshot_import|snapshotrestorephase|soap|softnuma|sort_in_tempdb|sorted_data|sorted_data_reorg|spatial|sql|sql_bigint|sql_binary|sql_bit|sql_char|sql_date|sql_decimal|sql_double|sql_float|sql_guid|sql_handle|sql_longvarbinary|sql_longvarchar|sql_numeric|sql_real|sql_smallint|sql_time|sql_timestamp|sql_tinyint|sql_tsi_day|sql_tsi_frac_second|sql_tsi_hour|sql_tsi_minute|sql_tsi_month|sql_tsi_quarter|sql_tsi_second|sql_tsi_week|sql_tsi_year|sql_type_date|sql_type_time|sql_type_timestamp|sql_varbinary|sql_varchar|sql_variant|sql_wchar|sql_wlongvarchar|ssl|ssl_port|standard|standby|start|start_date|started|stat_header|state|statement|static|statistics|statistics_incremental|statistics_norecompute|statistics_only|statman|stats|stats_stream|status|stop|stop_on_error|stopat|stopatmark|stopbeforemark|stoplist|stopped|string_delimiter|subject|supplemental_logging|supported|suspend|symmetric|synchronous_commit|synonym|sysname|system|system_time|system_versioning|table|tableresults|tablock|tablockx|take|tape|target|target_index|target_partition|target_recovery_time|tcp|temporal_history_retention|text|textimage_on|then|thesaurus|throw|time|timeout|timestamp|tinyint|to|top|torn_page_detection|track_columns_updated|trailing|tran|transaction|transfer|transform_noise_words|triple_des|triple_des_3key|truncate|trustworthy|try|tsql|two_digit_year_cutoff|type|type_desc|type_warning|tzoffset|uid|unbounded|uncommitted|unique|uniqueidentifier|unlimited|unload|unlock|unsafe|updlock|url|use|useplan|useroptions|use_type_default|using|utcdatetime|valid_xml|validation|value|values|varbinary|varchar|verbose|verifyonly|version|view_metadata|virtual_device|visiblity|wait_at_low_priority|waitfor|webmethod|week|weekday|weight|well_formed_xml|when|while|widechar|widechar_ansi|widenative|window|windows|with|within|within group|witness|without|without_array_wrapper|workload|wsdl|xact_abort|xlock|xml|xmlschema|xquery|xsinil|year|zone)\\b", + "match": "\\b(?i)(abort|abort_after_wait|absent|absolute|accent_sensitivity|acceptable_cursopt|acp|action|activation|add|address|admin|aes_128|aes_192|aes_256|affinity|after|aggregate|algorithm|all_constraints|all_errormsgs|all_indexes|all_levels|all_results|allow_connections|allow_dup_row|allow_encrypted_value_modifications|allow_page_locks|allow_row_locks|allow_snapshot_isolation|alter|altercolumn|always|anonymous|ansi_defaults|ansi_null_default|ansi_null_dflt_off|ansi_null_dflt_on|ansi_nulls|ansi_padding|ansi_warnings|appdomain|append|application|apply|arithabort|arithignore|array|assembly|asymmetric|asynchronous_commit|at|atan2|atomic|attach|attach_force_rebuild_log|attach_rebuild_log|audit|auth_realm|authentication|auto|auto_cleanup|auto_close|auto_create_statistics|auto_drop|auto_shrink|auto_update_statistics|auto_update_statistics_async|automated_backup_preference|automatic|autopilot|availability|availability_mode|backup|backup_priority|base64|basic|batches|batchsize|before|between|bigint|binary|binding|bit|block|blockers|blocksize|bmk|both|break|broker|broker_instance|bucket_count|buffer|buffercount|bulk_logged|by|call|caller|card|case|catalog|catch|cert|certificate|change_retention|change_tracking|change_tracking_context|changes|char|character|character_set|check_expiration|check_policy|checkconstraints|checkindex|checkpoint|checksum|cleanup_policy|clear|clear_port|close|clustered|codepage|collection|column_encryption_key|column_master_key|columnstore|columnstore_archive|colv_80_to_100|colv_100_to_80|commit_differential_base|committed|compatibility_level|compress_all_row_groups|compression|compression_delay|concat_null_yields_null|concatenate|configuration|connect|connection|containment|continue|continue_after_error|contract|contract_name|control|conversation|conversation_group_id|conversation_handle|copy|copy_only|count_rows|counter|create(\\\\s+or\\\\s+alter)?|credential|cross|cryptographic|cryptographic_provider|cube|cursor|cursor_close_on_commit|cursor_default|data|data_compression|data_flush_interval_seconds|data_mirroring|data_purity|data_source|database|database_name|database_snapshot|datafiletype|date_correlation_optimization|date|datefirst|dateformat|date_format|datetime|datetime2|datetimeoffset|day(s)?|db_chaining|dbid|dbidexec|dbo_only|deadlock_priority|deallocate|dec|decimal|declare|decrypt|decrypt_a|decryption|default_database|default_fulltext_language|default_language|default_logon_domain|default_schema|definition|delay|delayed_durability|delimitedtext|density_vector|dependent|des|description|desired_state|desx|differential|digest|disable|disable_broker|disable_def_cnst_chk|disabled|disk|distinct|distributed|distribution|drop|drop_existing|dts_buffers|dump|durability|dynamic|edition|elements|else|emergency|empty|enable|enable_broker|enabled|encoding|encrypted|encrypted_value|encryption|encryption_type|end|endpoint|endpoint_url|enhancedintegrity|entry|error_broker_conversations|errorfile|estimateonly|event|except|exec|executable|execute|exists|expand|expiredate|expiry_date|explicit|external|external_access|failover|failover_mode|failure_condition_level|fast|fast_forward|fastfirstrow|federated_service_account|fetch|field_terminator|fieldterminator|file|filelistonly|filegroup|filegrowth|filename|filestream|filestream_log|filestream_on|filetable|file_format|filter|first_row|fips_flagger|fire_triggers|first|firstrow|float|flush_interval_seconds|fmtonly|following|for|force|force_failover_allow_data_loss|force_service_allow_data_loss|forced|forceplan|formatfile|format_options|format_type|formsof|forward_only|free_cursors|free_exec_context|fullscan|fulltext|fulltextall|fulltextkey|function|generated|get|geography|geometry|global|go|goto|governor|guid|hadoop|hardening|hash|hashed|header_limit|headeronly|health_check_timeout|hidden|hierarchyid|histogram|histogram_steps|hits_cursors|hits_exec_context|hour(s)?|http|identity|identity_value|if|ifnull|ignore|ignore_constraints|ignore_dup_key|ignore_dup_row|ignore_triggers|image|immediate|implicit_transactions|include|include_null_values|incremental|index|inflectional|init|initiator|insensitive|insert|instead|int|integer|integrated|intersect|intermediate|interval_length_minutes|into|inuse_cursors|inuse_exec_context|io|is|isabout|iso_week|isolation|job_tracker_location|json|keep|keep_nulls|keep_replication|keepdefaults|keepfixed|keepidentity|keepnulls|kerberos|key|key_path|key_source|key_store_provider_name|keyset|kill|kilobytes_per_batch|labelonly|langid|language|last|lastrow|leading|legacy_cardinality_estimation|length|level|lifetime|lineage_80_to_100|lineage_100_to_80|listener_ip|listener_port|load|loadhistory|lob_compaction|local|local_service_name|locate|location|lock_escalation|lock_timeout|lockres|log|login|login_type|loop|manual|mark_in_use_for_removal|masked|master|match|matched|max_queue_readers|max_duration|max_outstanding_io_per_volume|maxdop|maxerrors|maxlength|maxtransfersize|max_plans_per_query|max_storage_size_mb|mediadescription|medianame|mediapassword|memogroup|memory_optimized|merge|message|message_forward_size|message_forwarding|microsecond|millisecond|minute(s)?|mirror_address|misses_cursors|misses_exec_context|mixed|modify|money|month|move|multi_user|must_change|name|namespace|nanosecond|native|native_compilation|nchar|ncharacter|nested_triggers|never|new_account|new_broker|newname|next|no|no_browsetable|no_checksum|no_compression|no_infomsgs|no_triggers|no_truncate|nocount|noexec|noexpand|noformat|noinit|nolock|nonatomic|nonclustered|nondurable|none|norecompute|norecovery|noreset|norewind|noskip|not|notification|nounload|now|nowait|ntext|ntlm|nulls|numeric|numeric_roundabort|nvarchar|object|objid|oem|offline|old_account|online|operation_mode|open|openjson|optimistic|option|orc|out|outer|output|over|override|owner|ownership|pad_index|page|page_checksum|page_verify|pagecount|paglock|param|parameter_sniffing|parameter_type_expansion|parameterization|parquet|parseonly|partial|partition|partner|password|path|pause|percentage|permission_set|persisted|period|physical_only|plan_forcing_mode|policy|pool|population|ports|preceding|precision|predicate|presume_abort|primary|primary_role|print|prior|priority |priority_level|private|proc(edure)?|procedure_name|profile|provider|quarter|query_capture_mode|query_governor_cost_limit|query_optimizer_hotfixes|query_store|queue|quoted_identifier|raiserror|range|raw|rcfile|rc2|rc4|rc4_128|rdbms|read_committed_snapshot|read|read_only|read_write|readcommitted|readcommittedlock|readonly|readpast|readuncommitted|readwrite|real|rebuild|receive|recmodel_70backcomp|recompile|reconfigure|recovery|recursive|recursive_triggers|redo_queue|reject_sample_value|reject_type|reject_value|relative|remote|remote_data_archive|remote_proc_transactions|remote_service_name|remove|removed_cursors|removed_exec_context|reorganize|repeat|repeatable|repeatableread|replace|replica|replicated|replnick_100_to_80|replnickarray_80_to_100|replnickarray_100_to_80|required|required_cursopt|resample|reset|resource|resource_manager_location|respect|restart|restore|restricted_user|resume|retaindays|retention|return|revert|rewind|rewindonly|returns|robust|role|rollup|root|round_robin|route|row|rowdump|rowguidcol|rowlock|row_terminator|rows|rows_per_batch|rowsets_only|rowterminator|rowversion|rsa_1024|rsa_2048|rsa_3072|rsa_4096|rsa_512|safe|safety|sample|save|scalar|schema|schemabinding|scoped|scroll|scroll_locks|sddl|second|secexpr|seconds|secondary|secondary_only|secondary_role|secret|security|securityaudit|selective|self|send|sent|sequence|serde_method|serializable|server|service|service_broker|service_name|service_objective|session_timeout|session|sessions|seterror|setopts|sets|shard_map_manager|shard_map_name|sharded|shared_memory|shortest_path|show_statistics|showplan_all|showplan_text|showplan_xml|showplan_xml_with_recompile|shrinkdb|shutdown|sid|signature|simple|single_blob|single_clob|single_nclob|single_user|singleton|site|size|size_based_cleanup_mode|skip|smalldatetime|smallint|smallmoney|snapshot|snapshot_import|snapshotrestorephase|soap|softnuma|sort_in_tempdb|sorted_data|sorted_data_reorg|spatial|sql|sql_bigint|sql_binary|sql_bit|sql_char|sql_date|sql_decimal|sql_double|sql_float|sql_guid|sql_handle|sql_longvarbinary|sql_longvarchar|sql_numeric|sql_real|sql_smallint|sql_time|sql_timestamp|sql_tinyint|sql_tsi_day|sql_tsi_frac_second|sql_tsi_hour|sql_tsi_minute|sql_tsi_month|sql_tsi_quarter|sql_tsi_second|sql_tsi_week|sql_tsi_year|sql_type_date|sql_type_time|sql_type_timestamp|sql_varbinary|sql_varchar|sql_variant|sql_wchar|sql_wlongvarchar|ssl|ssl_port|standard|standby|start|start_date|started|stat_header|state|statement|static|statistics|statistics_incremental|statistics_norecompute|statistics_only|statman|stats|stats_stream|status|stop|stop_on_error|stopat|stopatmark|stopbeforemark|stoplist|stopped|string_delimiter|subject|supplemental_logging|supported|suspend|symmetric|synchronous_commit|synonym|sysname|system|system_time|system_versioning|table|tableresults|tablock|tablockx|take|tape|target|target_index|target_partition|target_recovery_time|tcp|temporal_history_retention|text|textimage_on|then|thesaurus|throw|time|timeout|timestamp|tinyint|to|top|torn_page_detection|track_columns_updated|trailing|tran|transaction|transfer|transform_noise_words|triple_des|triple_des_3key|truncate|trustworthy|try|tsql|two_digit_year_cutoff|type|type_desc|type_warning|tzoffset|uid|unbounded|uncommitted|unique|uniqueidentifier|unlimited|unload|unlock|unsafe|updlock|url|use|useplan|useroptions|use_type_default|using|utcdatetime|valid_xml|validation|value|values|varbinary|varchar|verbose|verifyonly|version|view_metadata|virtual_device|visiblity|wait_at_low_priority|waitfor|webmethod|week|weekday|weight|well_formed_xml|when|while|widechar|widechar_ansi|widenative|window|windows|with|within|within group|witness|without|without_array_wrapper|workload|wsdl|xact_abort|xlock|xml|xmlschema|xquery|xsinil|year|zone)\\b", "name": "keyword.other.sql" }, { diff --git a/plugins/textmate/lib/bundles/swift/cgmanifest.json b/plugins/textmate/lib/bundles/swift/cgmanifest.json deleted file mode 100644 index a6e26d57d7cf..000000000000 --- a/plugins/textmate/lib/bundles/swift/cgmanifest.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "vscode-swift", - "repositoryUrl": "https://github.com/owensd/vscode-swift", - "commitHash": "cec27af6662e3799120b208e64483efdfe5521f5" - } - }, - "licenseDetail": [ - "The MIT License (MIT)", - "", - "Copyright (c) 2015 David Owens II", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and associated documentation files (the \"Software\"), to deal", - "in the Software without restriction, including without limitation the rights", - "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", - "copies of the Software, and to permit persons to whom the Software is", - "furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in all", - "copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", - "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", - "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", - "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." - ], - "license": "MIT", - "description": "The files in this folder are based on https://github.com/owensd/vscode-swift.", - "version": "0.0.1" - }, - { - "component": { - "type": "git", - "git": { - "name": "freebroccolo/atom-language-swift", - "repositoryUrl": "https://github.com/freebroccolo/atom-language-swift", - "commitHash": "d8f4ed1f79cbb4d5d215e7a68fa8cc6b618e16e0" - } - }, - "licenseDetail": [ - "The MIT License (MIT)", - "", - "Copyright (c) 2014 Darin Morrison", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and associated documentation files (the \"Software\"), to deal", - "in the Software without restriction, including without limitation the rights", - "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", - "copies of the Software, and to permit persons to whom the Software is", - "furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in all", - "copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", - "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", - "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", - "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." - ], - "license": "MIT", - "version": "0.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/swift/syntaxes/swift.tmLanguage.json b/plugins/textmate/lib/bundles/swift/syntaxes/swift.tmLanguage.json index f63b127dc620..6259b151369f 100644 --- a/plugins/textmate/lib/bundles/swift/syntaxes/swift.tmLanguage.json +++ b/plugins/textmate/lib/bundles/swift/syntaxes/swift.tmLanguage.json @@ -1,10 +1,10 @@ { "information_for_contributors": [ - "This file has been converted from https://github.com/textmate/swift.tmbundle/blob/master/Syntaxes/Swift.tmLanguage", + "This file has been converted from https://github.com/jtbandes/swift-tmlanguage/blob/master/Swift.tmLanguage.json", "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/swift.tmbundle/commit/7a35637eb70aef3114b091c4ff6fbf6a2faa881b", + "version": "https://github.com/jtbandes/swift-tmlanguage/commit/ab893c684dd7eeb7c249139e29e931334316fda7", "name": "Swift", "scopeName": "source.swift", "comment": "See swift.tmbundle/grammar-test.swift for test cases.", @@ -15,23 +15,25 @@ ], "repository": { "async-throws": { + "match": "\\b(?:(throws\\s+async|rethrows\\s+async)|(throws|rethrows)|(async))\\b", "captures": { "1": { "name": "invalid.illegal.await-must-precede-throws.swift" }, "2": { - "name": "keyword.control.exception.swift" + "name": "storage.modifier.exception.swift" }, "3": { - "name": "keyword.control.async.swift" + "name": "storage.modifier.async.swift" } - }, - "match": "\\b(?:(throws\\s+async|rethrows\\s+async)|(throws|rethrows)|(async))\\b" + } }, "attributes": { "patterns": [ { + "name": "meta.attribute.available.swift", "begin": "((@)available)(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "storage.modifier.attribute.swift" @@ -43,15 +45,14 @@ "name": "punctuation.definition.arguments.begin.swift" } }, - "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.arguments.end.swift" } }, - "name": "meta.attribute.available.swift", "patterns": [ { + "match": "\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?", "captures": { "1": { "name": "keyword.other.platform.os.swift" @@ -59,11 +60,11 @@ "2": { "name": "constant.numeric.swift" } - }, - "match": "\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?" + } }, { "begin": "\\b(introduced|deprecated|obsoleted)\\s*(:)\\s*", + "end": "(?!\\G)", "beginCaptures": { "1": { "name": "keyword.other.swift" @@ -72,16 +73,16 @@ "name": "punctuation.separator.key-value.swift" } }, - "end": "(?!\\G)", "patterns": [ { - "match": "\\b[0-9]+(?:\\.[0-9]+)*\\b", - "name": "constant.numeric.swift" + "name": "constant.numeric.swift", + "match": "\\b[0-9]+(?:\\.[0-9]+)*\\b" } ] }, { "begin": "\\b(message|renamed)\\s*(:)\\s*(?=\")", + "end": "(?!\\G)", "beginCaptures": { "1": { "name": "keyword.other.swift" @@ -90,7 +91,6 @@ "name": "punctuation.separator.key-value.swift" } }, - "end": "(?!\\G)", "patterns": [ { "include": "#literals" @@ -98,6 +98,7 @@ ] }, { + "match": "(?:(\\*)|\\b(deprecated|unavailable|noasync)\\b)\\s*(.*?)(?=[,)])", "captures": { "1": { "name": "keyword.other.platform.all.swift" @@ -108,13 +109,14 @@ "3": { "name": "invalid.illegal.character-not-allowed-here.swift" } - }, - "match": "(?:(\\*)|\\b(deprecated|unavailable|noasync)\\b)\\s*(.*?)(?=[,)])" + } } ] }, { + "name": "meta.attribute.objc.swift", "begin": "((@)objc)(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "storage.modifier.attribute.swift" @@ -126,27 +128,28 @@ "name": "punctuation.definition.arguments.begin.swift" } }, - "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.arguments.end.swift" } }, - "name": "meta.attribute.objc.swift", "patterns": [ { + "name": "entity.name.function.swift", + "match": "\\w*(?::(?:\\w*:)*(\\w*))?", "captures": { "1": { "name": "invalid.illegal.missing-colon-after-selector-piece.swift" } - }, - "match": "\\w*(?::(?:\\w*:)*(\\w*))?", - "name": "entity.name.function.swift" + } } ] }, { + "comment": "any other attribute", + "name": "meta.attribute.swift", "begin": "(@)(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)", + "end": "(?!\\G\\()", "beginCaptures": { "0": { "name": "storage.modifier.attribute.swift" @@ -161,24 +164,21 @@ "name": "punctuation.definition.identifier.swift" } }, - "comment": "any other attribute", - "end": "(?!\\G\\()", - "name": "meta.attribute.swift", "patterns": [ { + "name": "meta.arguments.attribute.swift", "begin": "\\(", + "end": "\\)", "beginCaptures": { "0": { "name": "punctuation.definition.arguments.begin.swift" } }, - "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.arguments.end.swift" } }, - "name": "meta.arguments.attribute.swift", "patterns": [ { "include": "#expressions" @@ -193,18 +193,18 @@ "patterns": [ { "comment": "Member functions in the standard library in Swift 3 which may be used with trailing closures and no parentheses", - "match": "(?<=\\.)(?:s(?:ort(?:ed)?|plit)|contains|index|partition|f(?:i(?:lter|rst)|orEach|latMap)|with(?:MutableCharacters|CString|U(?:nsafe(?:Mutable(?:BufferPointer|Pointer(?:s|To(?:Header|Elements)))|BufferPointer)|TF8Buffer))|m(?:in|a(?:p|x)))(?=\\s*[({])\\b", - "name": "support.function.swift" + "name": "support.function.swift", + "match": "(?<=\\.)(?:s(?:ort(?:ed)?|plit)|contains|index|partition|f(?:i(?:lter|rst)|orEach|latMap)|with(?:MutableCharacters|CString|U(?:nsafe(?:Mutable(?:BufferPointer|Pointer(?:s|To(?:Header|Elements)))|BufferPointer)|TF8Buffer))|m(?:in|a(?:p|x)))(?=\\s*[({])\\b" }, { "comment": "Member functions in the standard library in Swift 3", - "match": "(?<=\\.)(?:s(?:ymmetricDifference|t(?:oreBytes|arts|ride)|ortInPlace|u(?:ccessor|ffix|btract(?:ing|InPlace|WithOverflow)?)|quareRoot|amePosition)|h(?:oldsUnique(?:Reference|OrPinnedReference)|as(?:Suffix|Prefix))|ne(?:gate(?:d)?|xt)|c(?:o(?:untByEnumerating|py(?:Bytes)?)|lamp(?:ed)?|reate)|t(?:o(?:IntMax|Opaque|UIntMax)|ake(?:RetainedValue|UnretainedValue)|r(?:uncatingRemainder|a(?:nscodedLength|ilSurrogate)))|i(?:s(?:MutableAndUniquelyReferenced(?:OrPinned)?|S(?:trictSu(?:perset(?:Of)?|bset(?:Of)?)|u(?:perset(?:Of)?|bset(?:Of)?))|Continuation|T(?:otallyOrdered|railSurrogate)|Disjoint(?:With)?|Unique(?:Reference|lyReferenced(?:OrPinned)?)|Equal|Le(?:ss(?:ThanOrEqualTo)?|adSurrogate))|n(?:sert(?:ContentsOf)?|tersect(?:ion|InPlace)?|itialize(?:Memory|From)?|dex(?:Of|ForKey)))|o(?:verlaps|bjectAt)|d(?:i(?:stance(?:To)?|vide(?:d|WithOverflow)?)|e(?:s(?:cendant|troy)|code(?:CString)?|initialize|alloc(?:ate(?:Capacity)?)?)|rop(?:First|Last))|u(?:n(?:ion(?:InPlace)?|derestimateCount|wrappedOrError)|p(?:date(?:Value)?|percased))|join(?:ed|WithSeparator)|p(?:op(?:First|Last)|ass(?:Retained|Unretained)|re(?:decessor|fix))|e(?:scape(?:d)?|n(?:code|umerate(?:d)?)|lementsEqual|xclusiveOr(?:InPlace)?)|f(?:orm(?:Remainder|S(?:ymmetricDifference|quareRoot)|TruncatingRemainder|In(?:tersection|dex)|Union)|latten|rom(?:CString(?:RepairingIllFormedUTF8)?|Opaque))|w(?:i(?:thMemoryRebound|dth)|rite(?:To)?)|l(?:o(?:wercased|ad)|e(?:adSurrogate|xicographical(?:Compare|lyPrecedes)))|a(?:ss(?:ign(?:BackwardFrom|From)?|umingMemoryBound)|d(?:d(?:ing(?:Product)?|Product|WithOverflow)?|vanced(?:By)?)|utorelease|ppend(?:ContentsOf)?|lloc(?:ate)?|bs)|r(?:ound(?:ed)?|e(?:serveCapacity|tain|duce|place(?:Range|Subrange)?|verse(?:d)?|quest(?:NativeBuffer|UniqueMutableBackingBuffer)|lease|m(?:ove(?:Range|Subrange|Value(?:ForKey)?|First|Last|A(?:tIndex|ll))?|ainder(?:WithOverflow)?)))|ge(?:nerate|t(?:Objects|Element))|m(?:in(?:imum(?:Magnitude)?|Element)|ove(?:Initialize(?:Memory|BackwardFrom|From)?|Assign(?:From)?)?|ultipl(?:y(?:WithOverflow)?|ied)|easure|a(?:ke(?:Iterator|Description)|x(?:imum(?:Magnitude)?|Element)))|bindMemory)(?=\\s*\\()", - "name": "support.function.swift" + "name": "support.function.swift", + "match": "(?<=\\.)(?:s(?:ymmetricDifference|t(?:oreBytes|arts|ride)|ortInPlace|u(?:ccessor|ffix|btract(?:ing|InPlace|WithOverflow)?)|quareRoot|amePosition)|h(?:oldsUnique(?:Reference|OrPinnedReference)|as(?:Suffix|Prefix))|ne(?:gate(?:d)?|xt)|c(?:o(?:untByEnumerating|py(?:Bytes)?)|lamp(?:ed)?|reate)|t(?:o(?:IntMax|Opaque|UIntMax)|ake(?:RetainedValue|UnretainedValue)|r(?:uncatingRemainder|a(?:nscodedLength|ilSurrogate)))|i(?:s(?:MutableAndUniquelyReferenced(?:OrPinned)?|S(?:trictSu(?:perset(?:Of)?|bset(?:Of)?)|u(?:perset(?:Of)?|bset(?:Of)?))|Continuation|T(?:otallyOrdered|railSurrogate)|Disjoint(?:With)?|Unique(?:Reference|lyReferenced(?:OrPinned)?)|Equal|Le(?:ss(?:ThanOrEqualTo)?|adSurrogate))|n(?:sert(?:ContentsOf)?|tersect(?:ion|InPlace)?|itialize(?:Memory|From)?|dex(?:Of|ForKey)))|o(?:verlaps|bjectAt)|d(?:i(?:stance(?:To)?|vide(?:d|WithOverflow)?)|e(?:s(?:cendant|troy)|code(?:CString)?|initialize|alloc(?:ate(?:Capacity)?)?)|rop(?:First|Last))|u(?:n(?:ion(?:InPlace)?|derestimateCount|wrappedOrError)|p(?:date(?:Value)?|percased))|join(?:ed|WithSeparator)|p(?:op(?:First|Last)|ass(?:Retained|Unretained)|re(?:decessor|fix))|e(?:scape(?:d)?|n(?:code|umerate(?:d)?)|lementsEqual|xclusiveOr(?:InPlace)?)|f(?:orm(?:Remainder|S(?:ymmetricDifference|quareRoot)|TruncatingRemainder|In(?:tersection|dex)|Union)|latten|rom(?:CString(?:RepairingIllFormedUTF8)?|Opaque))|w(?:i(?:thMemoryRebound|dth)|rite(?:To)?)|l(?:o(?:wercased|ad)|e(?:adSurrogate|xicographical(?:Compare|lyPrecedes)))|a(?:ss(?:ign(?:BackwardFrom|From)?|umingMemoryBound)|d(?:d(?:ing(?:Product)?|Product|WithOverflow)?|vanced(?:By)?)|utorelease|ppend(?:ContentsOf)?|lloc(?:ate)?|bs)|r(?:ound(?:ed)?|e(?:serveCapacity|tain|duce|place(?:Range|Subrange)?|verse(?:d)?|quest(?:NativeBuffer|UniqueMutableBackingBuffer)|lease|m(?:ove(?:Range|Subrange|Value(?:ForKey)?|First|Last|A(?:tIndex|ll))?|ainder(?:WithOverflow)?)))|ge(?:nerate|t(?:Objects|Element))|m(?:in(?:imum(?:Magnitude)?|Element)|ove(?:Initialize(?:Memory|BackwardFrom|From)?|Assign(?:From)?)?|ultipl(?:y(?:WithOverflow)?|ied)|easure|a(?:ke(?:Iterator|Description)|x(?:imum(?:Magnitude)?|Element)))|bindMemory)(?=\\s*\\()" }, { "comment": "Member functions in the standard library in Swift 2 only", - "match": "(?<=\\.)(?:s(?:uperclassMirror|amePositionIn|tartsWith)|nextObject|c(?:haracterAtIndex|o(?:untByEnumeratingWithState|pyWithZone)|ustom(?:Mirror|PlaygroundQuickLook))|is(?:EmptyInput|ASCII)|object(?:Enumerator|ForKey|AtIndex)|join|put|keyEnumerator|withUnsafeMutablePointerToValue|length|getMirror|m(?:oveInitializeAssignFrom|ember))(?=\\s*\\()", - "name": "support.function.swift" + "name": "support.function.swift", + "match": "(?<=\\.)(?:s(?:uperclassMirror|amePositionIn|tartsWith)|nextObject|c(?:haracterAtIndex|o(?:untByEnumeratingWithState|pyWithZone)|ustom(?:Mirror|PlaygroundQuickLook))|is(?:EmptyInput|ASCII)|object(?:Enumerator|ForKey|AtIndex)|join|put|keyEnumerator|withUnsafeMutablePointerToValue|length|getMirror|m(?:oveInitializeAssignFrom|ember))(?=\\s*\\()" } ] }, @@ -212,6 +212,7 @@ "patterns": [ { "begin": "\\b(type)(\\()\\s*(of)(:)", + "end": "\\)", "beginCaptures": { "1": { "name": "support.function.dynamic-type.swift" @@ -226,7 +227,6 @@ "name": "punctuation.separator.argument-label.begin.swift" } }, - "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.arguments.end.swift" @@ -240,18 +240,18 @@ }, { "comment": "Global functions available in Swift 3 which may be used with trailing closures and no parentheses", - "match": "\\b(?:anyGenerator|autoreleasepool)(?=\\s*[({])\\b", - "name": "support.function.swift" + "name": "support.function.swift", + "match": "\\b(?:anyGenerator|autoreleasepool)(?=\\s*[({])\\b" }, { "comment": "Global functions available in Swift 3", - "match": "\\b(?:s(?:tride(?:of(?:Value)?)?|izeof(?:Value)?|equence|wap)|numericCast|transcode|is(?:UniquelyReferenced(?:NonObjC)?|KnownUniquelyReferenced)|zip|d(?:ump|ebugPrint)|unsafe(?:BitCast|Downcast|Unwrap|Address(?:Of)?)|pr(?:int|econdition(?:Failure)?)|fatalError|with(?:Unsafe(?:MutablePointer|Pointer)|ExtendedLifetime|VaList)|a(?:ssert(?:ionFailure)?|lignof(?:Value)?|bs)|re(?:peatElement|adLine)|getVaList|m(?:in|ax))(?=\\s*\\()", - "name": "support.function.swift" + "name": "support.function.swift", + "match": "\\b(?:s(?:tride(?:of(?:Value)?)?|izeof(?:Value)?|equence|wap)|numericCast|transcode|is(?:UniquelyReferenced(?:NonObjC)?|KnownUniquelyReferenced)|zip|d(?:ump|ebugPrint)|unsafe(?:BitCast|Downcast|Unwrap|Address(?:Of)?)|pr(?:int|econdition(?:Failure)?)|fatalError|with(?:Unsafe(?:MutablePointer|Pointer)|ExtendedLifetime|VaList)|a(?:ssert(?:ionFailure)?|lignof(?:Value)?|bs)|re(?:peatElement|adLine)|getVaList|m(?:in|ax))(?=\\s*\\()" }, { "comment": "Global functions available in Swift 2 only", - "match": "\\b(?:s(?:ort|uffix|pli(?:ce|t))|insert|overlaps|d(?:istance|rop(?:First|Last))|join|prefix|extend|withUnsafe(?:MutablePointers|Pointers)|lazy|advance|re(?:flect|move(?:Range|Last|A(?:tIndex|ll))))(?=\\s*\\()", - "name": "support.function.swift" + "name": "support.function.swift", + "match": "\\b(?:s(?:ort|uffix|pli(?:ce|t))|insert|overlaps|d(?:istance|rop(?:First|Last))|join|prefix|extend|withUnsafe(?:MutablePointers|Pointers)|lazy|advance|re(?:flect|move(?:Range|Last|A(?:tIndex|ll))))(?=\\s*\\()" } ] }, @@ -259,23 +259,23 @@ "patterns": [ { "comment": "The simpler (?<=\\bProcess\\.|\\bCommandLine\\.) breaks VS Code / Atom, see https://github.com/textmate/swift.tmbundle/issues/29", - "match": "(?<=^Process\\.|\\WProcess\\.|^CommandLine\\.|\\WCommandLine\\.)(arguments|argc|unsafeArgv)", - "name": "support.variable.swift" + "name": "support.variable.swift", + "match": "(?<=^Process\\.|\\WProcess\\.|^CommandLine\\.|\\WCommandLine\\.)(arguments|argc|unsafeArgv)" }, { "comment": "Properties in the standard library in Swift 3", - "match": "(?<=\\.)(?:s(?:t(?:artIndex|ri(?:ngValue|de))|i(?:ze|gn(?:BitIndex|ificand(?:Bit(?:Count|Pattern)|Width)?|alingNaN)?)|u(?:perclassMirror|mmary|bscriptBaseAddress))|h(?:eader|as(?:hValue|PointerRepresentation))|n(?:ulTerminatedUTF8|ext(?:Down|Up)|a(?:n|tiveOwner))|c(?:haracters|ount(?:TrailingZeros)?|ustom(?:Mirror|PlaygroundQuickLook)|apacity)|i(?:s(?:S(?:ign(?:Minus|aling(?:NaN)?)|ubnormal)|N(?:ormal|aN)|Canonical|Infinite|Zero|Empty|Finite|ASCII)|n(?:dices|finity)|dentity)|owner|de(?:scription|bugDescription)|u(?:n(?:safelyUnwrapped|icodeScalar(?:s)?|derestimatedCount)|tf(?:16|8(?:Start|C(?:String|odeUnitCount))?)|intValue|ppercaseString|lp(?:OfOne)?)|p(?:i|ointee)|e(?:ndIndex|lements|xponent(?:Bit(?:Count|Pattern))?)|value(?:s)?|keys|quietNaN|f(?:irst(?:ElementAddress(?:IfContiguous)?)?|loatingPointClass)|l(?:ittleEndian|owercaseString|eastNo(?:nzeroMagnitude|rmalMagnitude)|a(?:st|zy))|a(?:l(?:ignment|l(?:ocatedElementCount|Zeros))|rray(?:PropertyIsNativeTypeChecked)?)|ra(?:dix|wValue)|greatestFiniteMagnitude|m(?:in|emory|ax)|b(?:yteS(?:ize|wapped)|i(?:nade|tPattern|gEndian)|uffer|ase(?:Address)?))\\b", - "name": "support.variable.swift" + "name": "support.variable.swift", + "match": "(?<=\\.)(?:s(?:t(?:artIndex|ri(?:ngValue|de))|i(?:ze|gn(?:BitIndex|ificand(?:Bit(?:Count|Pattern)|Width)?|alingNaN)?)|u(?:perclassMirror|mmary|bscriptBaseAddress))|h(?:eader|as(?:hValue|PointerRepresentation))|n(?:ulTerminatedUTF8|ext(?:Down|Up)|a(?:n|tiveOwner))|c(?:haracters|ount(?:TrailingZeros)?|ustom(?:Mirror|PlaygroundQuickLook)|apacity)|i(?:s(?:S(?:ign(?:Minus|aling(?:NaN)?)|ubnormal)|N(?:ormal|aN)|Canonical|Infinite|Zero|Empty|Finite|ASCII)|n(?:dices|finity)|dentity)|owner|de(?:scription|bugDescription)|u(?:n(?:safelyUnwrapped|icodeScalar(?:s)?|derestimatedCount)|tf(?:16|8(?:Start|C(?:String|odeUnitCount))?)|intValue|ppercaseString|lp(?:OfOne)?)|p(?:i|ointee)|e(?:ndIndex|lements|xponent(?:Bit(?:Count|Pattern))?)|value(?:s)?|keys|quietNaN|f(?:irst(?:ElementAddress(?:IfContiguous)?)?|loatingPointClass)|l(?:ittleEndian|owercaseString|eastNo(?:nzeroMagnitude|rmalMagnitude)|a(?:st|zy))|a(?:l(?:ignment|l(?:ocatedElementCount|Zeros))|rray(?:PropertyIsNativeTypeChecked)?)|ra(?:dix|wValue)|greatestFiniteMagnitude|m(?:in|emory|ax)|b(?:yteS(?:ize|wapped)|i(?:nade|tPattern|gEndian)|uffer|ase(?:Address)?))\\b" }, { "comment": "Properties in the standard library in Swift 2 only", - "match": "(?<=\\.)(?:boolValue|disposition|end|objectIdentifier|quickLookObject|start|valueType)\\b", - "name": "support.variable.swift" + "name": "support.variable.swift", + "match": "(?<=\\.)(?:boolValue|disposition|end|objectIdentifier|quickLookObject|start|valueType)\\b" }, { "comment": "Enum cases in the standard library - note that there is some overlap between these and the properties", - "match": "(?<=\\.)(?:s(?:calarValue|i(?:ze|gnalingNaN)|o(?:und|me)|uppressed|prite|et)|n(?:one|egative(?:Subnormal|Normal|Infinity|Zero))|c(?:ol(?:or|lection)|ustomized)|t(?:o(?:NearestOr(?:Even|AwayFromZero)|wardZero)|uple|ext)|i(?:nt|mage)|optional|d(?:ictionary|o(?:uble|wn))|u(?:Int|p|rl)|p(?:o(?:sitive(?:Subnormal|Normal|Infinity|Zero)|int)|lus)|e(?:rror|mptyInput)|view|quietNaN|float|a(?:ttributedString|wayFromZero)|r(?:ectangle|ange)|generated|minus|b(?:ool|ezierPath))\\b", - "name": "support.variable.swift" + "name": "support.variable.swift", + "match": "(?<=\\.)(?:s(?:calarValue|i(?:ze|gnalingNaN)|o(?:und|me)|uppressed|prite|et)|n(?:one|egative(?:Subnormal|Normal|Infinity|Zero))|c(?:ol(?:or|lection)|ustomized)|t(?:o(?:NearestOr(?:Even|AwayFromZero)|wardZero)|uple|ext)|i(?:nt|mage)|optional|d(?:ictionary|o(?:uble|wn))|u(?:Int|p|rl)|p(?:o(?:sitive(?:Subnormal|Normal|Infinity|Zero)|int)|lus)|e(?:rror|mptyInput)|view|quietNaN|float|a(?:ttributedString|wayFromZero)|r(?:ectangle|ange)|generated|minus|b(?:ool|ezierPath))\\b" } ] }, @@ -283,107 +283,105 @@ "comment": "Types provided in the standard library", "patterns": [ { - "include": "#builtin-class-type" + "include": "#builtin-types-builtin-class-type" }, { - "include": "#builtin-enum-type" + "include": "#builtin-types-builtin-enum-type" }, { - "include": "#builtin-protocol-type" + "include": "#builtin-types-builtin-protocol-type" }, { - "include": "#builtin-struct-type" + "include": "#builtin-types-builtin-struct-type" }, { - "include": "#builtin-typealias" + "include": "#builtin-types-builtin-typealias" }, { - "match": "\\bAny\\b", - "name": "support.type.any.swift" + "name": "support.type.any.swift", + "match": "\\bAny\\b" } - ], - "repository": { - "builtin-class-type": { - "comment": "Builtin class types", - "match": "\\b(Managed(Buffer|ProtoBuffer)|NonObjectiveCBase|AnyGenerator)\\b", - "name": "support.class.swift" + ] + }, + "builtin-types-builtin-class-type": { + "comment": "Builtin class types", + "name": "support.class.swift", + "match": "\\b(Managed(Buffer|ProtoBuffer)|NonObjectiveCBase|AnyGenerator)\\b" + }, + "builtin-types-builtin-enum-type": { + "patterns": [ + { + "comment": "CommandLine is an enum, but it acts like a constant", + "name": "support.constant.swift", + "match": "\\b(?:CommandLine|Process(?=\\.))\\b" }, - "builtin-enum-type": { - "patterns": [ - { - "comment": "CommandLine is an enum, but it acts like a constant", - "match": "\\b(?:CommandLine|Process(?=\\.))\\b", - "name": "support.constant.swift" - }, - { - "comment": "The return type of a function that never returns", - "match": "\\bNever\\b", - "name": "support.constant.never.swift" - }, - { - "comment": "Enum types in the standard library in Swift 3", - "match": "\\b(?:ImplicitlyUnwrappedOptional|Representation|MemoryLayout|FloatingPointClassification|SetIndexRepresentation|SetIteratorRepresentation|FloatingPointRoundingRule|UnicodeDecodingResult|Optional|DictionaryIndexRepresentation|AncestorRepresentation|DisplayStyle|PlaygroundQuickLook|Never|FloatingPointSign|Bit|DictionaryIteratorRepresentation)\\b", - "name": "support.type.swift" - }, - { - "comment": "Enum types in the standard library in Swift 2 only", - "match": "\\b(?:MirrorDisposition|QuickLookObject)\\b", - "name": "support.type.swift" - } - ] + { + "comment": "The return type of a function that never returns", + "name": "support.constant.never.swift", + "match": "\\bNever\\b" }, - "builtin-protocol-type": { - "patterns": [ - { - "comment": "Protocols in the standard library in Swift 3", - "match": "\\b(?:Ra(?:n(?:domAccess(?:Collection|Indexable)|geReplaceable(?:Collection|Indexable))|wRepresentable)|M(?:irrorPath|utable(?:Collection|Indexable))|Bi(?:naryFloatingPoint|twiseOperations|directional(?:Collection|Indexable))|S(?:tr(?:ideable|eamable)|igned(?:Number|Integer)|e(?:tAlgebra|quence))|Hashable|C(?:o(?:llection|mparable)|ustom(?:Reflectable|StringConvertible|DebugStringConvertible|PlaygroundQuickLookable|LeafReflectable)|VarArg)|TextOutputStream|I(?:n(?:teger(?:Arithmetic)?|dexable(?:Base)?)|teratorProtocol)|OptionSet|Un(?:signedInteger|icodeCodec)|E(?:quatable|rror|xpressibleBy(?:BooleanLiteral|String(?:Interpolation|Literal)|NilLiteral|IntegerLiteral|DictionaryLiteral|UnicodeScalarLiteral|ExtendedGraphemeClusterLiteral|FloatLiteral|ArrayLiteral))|FloatingPoint|L(?:osslessStringConvertible|azy(?:SequenceProtocol|CollectionProtocol))|A(?:nyObject|bsoluteValuable))\\b", - "name": "support.type.swift" - }, - { - "comment": "Protocols in the standard library in Swift 2 only", - "match": "\\b(?:Ran(?:domAccessIndexType|geReplaceableCollectionType)|GeneratorType|M(?:irror(?:Type|PathType)|utable(?:Sliceable|CollectionType))|B(?:i(?:twiseOperationsType|directionalIndexType)|oolean(?:Type|LiteralConvertible))|S(?:tring(?:InterpolationConvertible|LiteralConvertible)|i(?:nkType|gned(?:NumberType|IntegerType))|e(?:tAlgebraType|quenceType)|liceable)|NilLiteralConvertible|C(?:ollectionType|VarArgType)|Inte(?:rvalType|ger(?:Type|LiteralConvertible|ArithmeticType))|O(?:utputStreamType|ptionSetType)|DictionaryLiteralConvertible|Un(?:signedIntegerType|icode(?:ScalarLiteralConvertible|CodecType))|E(?:rrorType|xten(?:sibleCollectionType|dedGraphemeClusterLiteralConvertible))|F(?:orwardIndexType|loat(?:ingPointType|LiteralConvertible))|A(?:nyCollectionType|rrayLiteralConvertible))\\b", - "name": "support.type.swift" - } - ] + { + "comment": "Enum types in the standard library in Swift 3", + "name": "support.type.swift", + "match": "\\b(?:ImplicitlyUnwrappedOptional|Representation|MemoryLayout|FloatingPointClassification|SetIndexRepresentation|SetIteratorRepresentation|FloatingPointRoundingRule|UnicodeDecodingResult|Optional|DictionaryIndexRepresentation|AncestorRepresentation|DisplayStyle|PlaygroundQuickLook|Never|FloatingPointSign|Bit|DictionaryIteratorRepresentation)\\b" }, - "builtin-struct-type": { - "patterns": [ - { - "comment": "Structs in the standard library in Swift 3", - "match": "\\b(?:R(?:e(?:peat(?:ed)?|versed(?:RandomAccess(?:Collection|Index)|Collection|Index))|an(?:domAccessSlice|ge(?:Replaceable(?:RandomAccessSlice|BidirectionalSlice|Slice)|Generator)?))|Generator(?:Sequence|OfOne)|M(?:irror|utable(?:Ran(?:domAccessSlice|geReplaceable(?:RandomAccessSlice|BidirectionalSlice|Slice))|BidirectionalSlice|Slice)|anagedBufferPointer)|B(?:idirectionalSlice|ool)|S(?:t(?:aticString|ri(?:ng|deT(?:hrough(?:Generator|Iterator)?|o(?:Generator|Iterator)?)))|et(?:I(?:ndex|terator))?|lice)|HalfOpenInterval|C(?:haracter(?:View)?|o(?:ntiguousArray|untable(?:Range|ClosedRange)|llectionOfOne)|OpaquePointer|losed(?:Range(?:I(?:ndex|terator))?|Interval)|VaListPointer)|I(?:n(?:t(?:16|8|32|64)?|d(?:ices|ex(?:ing(?:Generator|Iterator))?))|terator(?:Sequence|OverOne)?)|Zip2(?:Sequence|Iterator)|O(?:paquePointer|bjectIdentifier)|D(?:ictionary(?:I(?:ndex|terator)|Literal)?|ouble|efault(?:RandomAccessIndices|BidirectionalIndices|Indices))|U(?:n(?:safe(?:RawPointer|Mutable(?:RawPointer|BufferPointer|Pointer)|BufferPointer(?:Generator|Iterator)?|Pointer)|icodeScalar(?:View)?|foldSequence|managed)|TF(?:16(?:View)?|8(?:View)?|32)|Int(?:16|8|32|64)?)|Join(?:Generator|ed(?:Sequence|Iterator))|PermutationGenerator|E(?:numerate(?:Generator|Sequence|d(?:Sequence|Iterator))|mpty(?:Generator|Collection|Iterator))|Fl(?:oat(?:80)?|atten(?:Generator|BidirectionalCollection(?:Index)?|Sequence|Collection(?:Index)?|Iterator))|L(?:egacyChildren|azy(?:RandomAccessCollection|Map(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Collection|Iterator)|BidirectionalCollection|Sequence|Collection|Filter(?:Generator|BidirectionalCollection|Sequence|Collection|I(?:ndex|terator))))|A(?:ny(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Hashable|Collection|I(?:ndex|terator))|utoreleasingUnsafeMutablePointer|rray(?:Slice)?))\\b", - "name": "support.type.swift" - }, - { - "comment": "Structs in the standard library in Swift 2 only", - "match": "\\b(?:R(?:everse(?:RandomAccess(?:Collection|Index)|Collection|Index)|awByte)|Map(?:Generator|Sequence|Collection)|S(?:inkOf|etGenerator)|Zip2Generator|DictionaryGenerator|Filter(?:Generator|Sequence|Collection(?:Index)?)|LazyForwardCollection|Any(?:RandomAccessIndex|BidirectionalIndex|Forward(?:Collection|Index)))\\b", - "name": "support.type.swift" - } - ] - }, - "builtin-typealias": { - "patterns": [ - { - "comment": "Typealiases in the standard library in Swift 3", - "match": "\\b(?:Raw(?:Significand|Exponent|Value)|B(?:ooleanLiteralType|uffer|ase)|S(?:t(?:orage|r(?:i(?:ngLiteralType|de)|eam(?:1|2)))|ubSequence)|NativeBuffer|C(?:hild(?:ren)?|Bool|S(?:hort|ignedChar)|odeUnit|Char(?:16|32)?|Int|Double|Unsigned(?:Short|Char|Int|Long(?:Long)?)|Float|WideChar|Long(?:Long)?)|I(?:n(?:t(?:Max|egerLiteralType)|d(?:ices|ex(?:Distance)?))|terator)|Distance|U(?:n(?:icodeScalar(?:Type|Index|View|LiteralType)|foldFirstSequence)|TF(?:16(?:Index|View)|8Index)|IntMax)|E(?:lement(?:s)?|x(?:tendedGraphemeCluster(?:Type|LiteralType)|ponent))|V(?:oid|alue)|Key|Float(?:32|LiteralType|64)|AnyClass)\\b", - "name": "support.type.swift" - }, - { - "comment": "Typealiases in the standard library in Swift 2 only", - "match": "\\b(?:Generator|PlaygroundQuickLook|UWord|Word)\\b", - "name": "support.type.swift" - } - ] + { + "comment": "Enum types in the standard library in Swift 2 only", + "name": "support.type.swift", + "match": "\\b(?:MirrorDisposition|QuickLookObject)\\b" } - } + ] + }, + "builtin-types-builtin-protocol-type": { + "patterns": [ + { + "comment": "Protocols in the standard library in Swift 3", + "name": "support.type.swift", + "match": "\\b(?:Ra(?:n(?:domAccess(?:Collection|Indexable)|geReplaceable(?:Collection|Indexable))|wRepresentable)|M(?:irrorPath|utable(?:Collection|Indexable))|Bi(?:naryFloatingPoint|twiseOperations|directional(?:Collection|Indexable))|S(?:tr(?:ideable|eamable)|igned(?:Number|Integer)|e(?:tAlgebra|quence))|Hashable|C(?:o(?:llection|mparable)|ustom(?:Reflectable|StringConvertible|DebugStringConvertible|PlaygroundQuickLookable|LeafReflectable)|VarArg)|TextOutputStream|I(?:n(?:teger(?:Arithmetic)?|dexable(?:Base)?)|teratorProtocol)|OptionSet|Un(?:signedInteger|icodeCodec)|E(?:quatable|rror|xpressibleBy(?:BooleanLiteral|String(?:Interpolation|Literal)|NilLiteral|IntegerLiteral|DictionaryLiteral|UnicodeScalarLiteral|ExtendedGraphemeClusterLiteral|FloatLiteral|ArrayLiteral))|FloatingPoint|L(?:osslessStringConvertible|azy(?:SequenceProtocol|CollectionProtocol))|A(?:nyObject|bsoluteValuable))\\b" + }, + { + "comment": "Protocols in the standard library in Swift 2 only", + "name": "support.type.swift", + "match": "\\b(?:Ran(?:domAccessIndexType|geReplaceableCollectionType)|GeneratorType|M(?:irror(?:Type|PathType)|utable(?:Sliceable|CollectionType))|B(?:i(?:twiseOperationsType|directionalIndexType)|oolean(?:Type|LiteralConvertible))|S(?:tring(?:InterpolationConvertible|LiteralConvertible)|i(?:nkType|gned(?:NumberType|IntegerType))|e(?:tAlgebraType|quenceType)|liceable)|NilLiteralConvertible|C(?:ollectionType|VarArgType)|Inte(?:rvalType|ger(?:Type|LiteralConvertible|ArithmeticType))|O(?:utputStreamType|ptionSetType)|DictionaryLiteralConvertible|Un(?:signedIntegerType|icode(?:ScalarLiteralConvertible|CodecType))|E(?:rrorType|xten(?:sibleCollectionType|dedGraphemeClusterLiteralConvertible))|F(?:orwardIndexType|loat(?:ingPointType|LiteralConvertible))|A(?:nyCollectionType|rrayLiteralConvertible))\\b" + } + ] + }, + "builtin-types-builtin-struct-type": { + "patterns": [ + { + "comment": "Structs in the standard library in Swift 3", + "name": "support.type.swift", + "match": "\\b(?:R(?:e(?:peat(?:ed)?|versed(?:RandomAccess(?:Collection|Index)|Collection|Index))|an(?:domAccessSlice|ge(?:Replaceable(?:RandomAccessSlice|BidirectionalSlice|Slice)|Generator)?))|Generator(?:Sequence|OfOne)|M(?:irror|utable(?:Ran(?:domAccessSlice|geReplaceable(?:RandomAccessSlice|BidirectionalSlice|Slice))|BidirectionalSlice|Slice)|anagedBufferPointer)|B(?:idirectionalSlice|ool)|S(?:t(?:aticString|ri(?:ng|deT(?:hrough(?:Generator|Iterator)?|o(?:Generator|Iterator)?)))|et(?:I(?:ndex|terator))?|lice)|HalfOpenInterval|C(?:haracter(?:View)?|o(?:ntiguousArray|untable(?:Range|ClosedRange)|llectionOfOne)|OpaquePointer|losed(?:Range(?:I(?:ndex|terator))?|Interval)|VaListPointer)|I(?:n(?:t(?:16|8|32|64)?|d(?:ices|ex(?:ing(?:Generator|Iterator))?))|terator(?:Sequence|OverOne)?)|Zip2(?:Sequence|Iterator)|O(?:paquePointer|bjectIdentifier)|D(?:ictionary(?:I(?:ndex|terator)|Literal)?|ouble|efault(?:RandomAccessIndices|BidirectionalIndices|Indices))|U(?:n(?:safe(?:RawPointer|Mutable(?:RawPointer|BufferPointer|Pointer)|BufferPointer(?:Generator|Iterator)?|Pointer)|icodeScalar(?:View)?|foldSequence|managed)|TF(?:16(?:View)?|8(?:View)?|32)|Int(?:16|8|32|64)?)|Join(?:Generator|ed(?:Sequence|Iterator))|PermutationGenerator|E(?:numerate(?:Generator|Sequence|d(?:Sequence|Iterator))|mpty(?:Generator|Collection|Iterator))|Fl(?:oat(?:80)?|atten(?:Generator|BidirectionalCollection(?:Index)?|Sequence|Collection(?:Index)?|Iterator))|L(?:egacyChildren|azy(?:RandomAccessCollection|Map(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Collection|Iterator)|BidirectionalCollection|Sequence|Collection|Filter(?:Generator|BidirectionalCollection|Sequence|Collection|I(?:ndex|terator))))|A(?:ny(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Hashable|Collection|I(?:ndex|terator))|utoreleasingUnsafeMutablePointer|rray(?:Slice)?))\\b" + }, + { + "comment": "Structs in the standard library in Swift 2 only", + "name": "support.type.swift", + "match": "\\b(?:R(?:everse(?:RandomAccess(?:Collection|Index)|Collection|Index)|awByte)|Map(?:Generator|Sequence|Collection)|S(?:inkOf|etGenerator)|Zip2Generator|DictionaryGenerator|Filter(?:Generator|Sequence|Collection(?:Index)?)|LazyForwardCollection|Any(?:RandomAccessIndex|BidirectionalIndex|Forward(?:Collection|Index)))\\b" + } + ] + }, + "builtin-types-builtin-typealias": { + "patterns": [ + { + "comment": "Typealiases in the standard library in Swift 3", + "name": "support.type.swift", + "match": "\\b(?:Raw(?:Significand|Exponent|Value)|B(?:ooleanLiteralType|uffer|ase)|S(?:t(?:orage|r(?:i(?:ngLiteralType|de)|eam(?:1|2)))|ubSequence)|NativeBuffer|C(?:hild(?:ren)?|Bool|S(?:hort|ignedChar)|odeUnit|Char(?:16|32)?|Int|Double|Unsigned(?:Short|Char|Int|Long(?:Long)?)|Float|WideChar|Long(?:Long)?)|I(?:n(?:t(?:Max|egerLiteralType)|d(?:ices|ex(?:Distance)?))|terator)|Distance|U(?:n(?:icodeScalar(?:Type|Index|View|LiteralType)|foldFirstSequence)|TF(?:16(?:Index|View)|8Index)|IntMax)|E(?:lement(?:s)?|x(?:tendedGraphemeCluster(?:Type|LiteralType)|ponent))|V(?:oid|alue)|Key|Float(?:32|LiteralType|64)|AnyClass)\\b" + }, + { + "comment": "Typealiases in the standard library in Swift 2 only", + "name": "support.type.swift", + "match": "\\b(?:Generator|PlaygroundQuickLook|UWord|Word)\\b" + } + ] }, "code-block": { "begin": "\\{", + "end": "\\}", "beginCaptures": { "0": { "name": "punctuation.section.scope.begin.swift" } }, - "end": "\\}", "endCaptures": { "0": { "name": "punctuation.section.scope.end.swift" @@ -398,136 +396,136 @@ "comments": { "patterns": [ { + "name": "comment.line.number-sign.swift", + "match": "\\A^(#!).*$\\n?", "captures": { "1": { "name": "punctuation.definition.comment.swift" } - }, - "match": "\\A^(#!).*$\\n?", - "name": "comment.line.number-sign.swift" + } }, { - "begin": "/\\*\\*(?!/)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.begin.swift" - } - }, - "end": "\\*/", - "endCaptures": { - "0": { - "name": "punctuation.definition.comment.end.swift" - } - }, "name": "comment.block.documentation.swift", - "patterns": [ - { - "include": "#nested" - } - ] - }, - { - "begin": "/\\*:", + "begin": "/\\*\\*(?!/)", + "end": "\\*/", "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.swift" } }, - "end": "\\*/", "endCaptures": { "0": { "name": "punctuation.definition.comment.end.swift" } }, + "patterns": [ + { + "include": "#comments-nested" + } + ] + }, + { "name": "comment.block.documentation.playground.swift", - "patterns": [ - { - "include": "#nested" - } - ] - }, - { - "begin": "/\\*", + "begin": "/\\*:", + "end": "\\*/", "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.swift" } }, - "end": "\\*/", "endCaptures": { "0": { "name": "punctuation.definition.comment.end.swift" } }, - "name": "comment.block.swift", "patterns": [ { - "include": "#nested" + "include": "#comments-nested" } ] }, { - "match": "\\*/", - "name": "invalid.illegal.unexpected-end-of-block-comment.swift" + "name": "comment.block.swift", + "begin": "/\\*", + "end": "\\*/", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.swift" + } + }, + "patterns": [ + { + "include": "#comments-nested" + } + ] + }, + { + "name": "invalid.illegal.unexpected-end-of-block-comment.swift", + "match": "\\*/" }, { "begin": "(^[ \\t]+)?(?=//)", + "end": "(?!\\G)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.swift" } }, - "end": "(?!\\G)", "patterns": [ { + "name": "comment.line.triple-slash.documentation.swift", "begin": "///", + "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.swift" } - }, - "end": "^", - "name": "comment.line.triple-slash.documentation.swift" + } }, { + "name": "comment.line.double-slash.documentation.swift", "begin": "//:", + "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.swift" } - }, - "end": "^", - "name": "comment.line.double-slash.documentation.swift" + } }, { + "name": "comment.line.double-slash.swift", "begin": "//", + "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.swift" } - }, - "end": "^", - "name": "comment.line.double-slash.swift" + } } ] } - ], - "repository": { - "nested": { - "begin": "/\\*", - "end": "\\*/", - "patterns": [ - { - "include": "#nested" - } - ] + ] + }, + "comments-nested": { + "begin": "/\\*", + "end": "\\*/", + "patterns": [ + { + "include": "#comments-nested" } - } + ] }, "compiler-control": { "patterns": [ { + "contentName": "comment.block.preprocessor.swift", "begin": "^\\s*(#)(if|elseif)\\s+(false)\\b.*?(?=$|//|/\\*)", + "end": "(?=^\\s*(#(elseif|else|endif)\\b))", "beginCaptures": { "0": { "name": "meta.preprocessor.conditional.swift" @@ -536,37 +534,36 @@ "name": "punctuation.definition.preprocessor.swift" }, "2": { - "name": "keyword.control.preprocessor.conditional.swift" + "name": "keyword.control.import.preprocessor.conditional.swift" }, "3": { "name": "constant.language.boolean.swift" } - }, - "contentName": "comment.block.preprocessor.swift", - "end": "(?=^\\s*(#(elseif|else|endif)\\b))" + } }, { - "begin": "^\\s*(#)(if|elseif)\\s+", + "name": "meta.preprocessor.conditional.swift", "captures": { "1": { "name": "punctuation.definition.preprocessor.swift" }, "2": { - "name": "keyword.control.preprocessor.conditional.swift" + "name": "keyword.control.import.preprocessor.conditional.swift" } }, + "begin": "^\\s*(#)(if|elseif)\\s+", "end": "(?=\\s*(?://|/\\*))|$", - "name": "meta.preprocessor.conditional.swift", "patterns": [ { - "match": "(&&|\\|\\|)", - "name": "keyword.operator.logical.swift" + "name": "keyword.operator.logical.swift", + "match": "(&&|\\|\\|)" }, { - "match": "\\b(true|false)\\b", - "name": "constant.language.boolean.swift" + "name": "constant.language.boolean.swift", + "match": "\\b(true|false)\\b" }, { + "match": "\\b(arch)\\s*(\\()\\s*(?:(arm|arm64|powerpc64|powerpc64le|i386|x86_64|s390x)|\\w+)\\s*(\\))", "captures": { "1": { "name": "keyword.other.condition.swift" @@ -580,10 +577,10 @@ "4": { "name": "punctuation.definition.parameters.end.swift" } - }, - "match": "\\b(arch)\\s*(\\()\\s*(?:(arm|arm64|powerpc64|powerpc64le|i386|x86_64|s390x)|\\w+)\\s*(\\))" + } }, { + "match": "\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))", "captures": { "1": { "name": "keyword.other.condition.swift" @@ -597,10 +594,10 @@ "4": { "name": "punctuation.definition.parameters.end.swift" } - }, - "match": "\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))" + } }, { + "match": "\\b(canImport)\\s*(\\()([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)(\\))", "captures": { "1": { "name": "keyword.other.condition.swift" @@ -614,11 +611,11 @@ "4": { "name": "punctuation.definition.parameters.end.swift" } - }, - "match": "\\b(canImport)\\s*(\\()([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)(\\))" + } }, { "begin": "\\b(targetEnvironment)\\s*(\\()", + "end": "(\\))|$", "beginCaptures": { "1": { "name": "keyword.other.condition.swift" @@ -627,7 +624,6 @@ "name": "punctuation.definition.parameters.begin.swift" } }, - "end": "(\\))|$", "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.swift" @@ -635,13 +631,14 @@ }, "patterns": [ { - "match": "\\b(simulator|UIKitForMac)\\b", - "name": "support.constant.platform.environment.swift" + "name": "support.constant.platform.environment.swift", + "match": "\\b(simulator|UIKitForMac)\\b" } ] }, { "begin": "\\b(swift|compiler)\\s*(\\()", + "end": "(\\))|$", "beginCaptures": { "1": { "name": "keyword.other.condition.swift" @@ -650,7 +647,6 @@ "name": "punctuation.definition.parameters.begin.swift" } }, - "end": "(\\))|$", "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.swift" @@ -658,44 +654,46 @@ }, "patterns": [ { - "match": ">=|<", - "name": "keyword.operator.comparison.swift" + "name": "keyword.operator.comparison.swift", + "match": ">=|<" }, { - "match": "\\b[0-9]+(?:\\.[0-9]+)*\\b", - "name": "constant.numeric.swift" + "name": "constant.numeric.swift", + "match": "\\b[0-9]+(?:\\.[0-9]+)*\\b" } ] } ] }, { + "name": "meta.preprocessor.conditional.swift", + "match": "^\\s*(#)(else|endif)(.*?)(?=$|//|/\\*)", "captures": { "1": { "name": "punctuation.definition.preprocessor.swift" }, "2": { - "name": "keyword.control.preprocessor.conditional.swift" + "name": "keyword.control.import.preprocessor.conditional.swift" }, "3": { "patterns": [ { - "match": "\\S+", - "name": "invalid.illegal.character-not-allowed-here.swift" + "name": "invalid.illegal.character-not-allowed-here.swift", + "match": "\\S+" } ] } - }, - "match": "^\\s*(#)(else|endif)(.*?)(?=$|//|/\\*)", - "name": "meta.preprocessor.conditional.swift" + } }, { + "name": "meta.preprocessor.sourcelocation.swift", + "match": "^\\s*(#)(sourceLocation)((\\()([^)]*)(\\)))(.*?)(?=$|//|/\\*)", "captures": { "1": { "name": "punctuation.definition.preprocessor.swift" }, "2": { - "name": "keyword.control.preprocessor.sourcelocation.swift" + "name": "keyword.control.import.preprocessor.sourcelocation.swift" }, "4": { "name": "punctuation.definition.parameters.begin.swift" @@ -704,6 +702,7 @@ "patterns": [ { "begin": "(file)\\s*(:)\\s*(?=\")", + "end": "(?!\\G)", "beginCaptures": { "1": { "name": "support.variable.parameter.swift" @@ -712,7 +711,6 @@ "name": "punctuation.separator.key-value.swift" } }, - "end": "(?!\\G)", "patterns": [ { "include": "#literals" @@ -720,6 +718,7 @@ ] }, { + "match": "(line)\\s*(:)\\s*([0-9]+)", "captures": { "1": { "name": "support.variable.parameter.swift" @@ -730,16 +729,15 @@ "3": { "name": "constant.numeric.integer.swift" } - }, - "match": "(line)\\s*(:)\\s*([0-9]+)" + } }, { - "match": ",", - "name": "punctuation.separator.parameters.swift" + "name": "punctuation.separator.parameters.swift", + "match": "," }, { - "match": "\\S+", - "name": "invalid.illegal.character-not-allowed-here.swift" + "name": "invalid.illegal.character-not-allowed-here.swift", + "match": "\\S+" } ] }, @@ -749,1545 +747,1766 @@ "7": { "patterns": [ { - "match": "\\S+", - "name": "invalid.illegal.character-not-allowed-here.swift" + "name": "invalid.illegal.character-not-allowed-here.swift", + "match": "\\S+" + } + ] + } + } + } + ] + }, + "conditionals": { + "patterns": [ + { + "begin": "(?&|\\^~.])(->)(?![/=\\-+!*%<>&|\\^~.])" - }, - { - "captures": { - "1": { - "name": "keyword.operator.type.composition.swift" - } - }, - "comment": "Swift 3: A & B", - "match": "(?&|\\^~.])(&)(?![/=\\-+!*%<>&|\\^~.])" - }, - { - "match": "[?!]", - "name": "keyword.operator.type.optional.swift" - }, - { - "match": "\\.\\.\\.", - "name": "keyword.operator.function.variadic-parameter.swift" - }, - { - "comment": "Swift 2: protocol", - "match": "\\bprotocol\\b", + ] + }, + "declarations-available-types": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#builtin-types" + }, + { + "include": "#attributes" + }, + { + "name": "storage.modifier.async.swift", + "match": "\\basync\\b" + }, + { + "name": "storage.modifier.exception.swift", + "match": "\\b(?:throws|rethrows)\\b" + }, + { + "name": "keyword.other.operator.type.opaque.swift", + "match": "\\bsome\\b" + }, + { + "name": "keyword.other.operator.type.existential.swift", + "match": "\\bany\\b" + }, + { + "name": "keyword.control.loop.swift", + "match": "\\b(?:repeat|each)\\b" + }, + { + "name": "storage.modifier.swift", + "match": "\\b(?:inout|isolated|borrowing|consuming)\\b" + }, + { + "name": "variable.language.swift", + "match": "\\bSelf\\b" + }, + { + "match": "(?&|\\^~.])(->)(?![/=\\-+!*%<>&|\\^~.])", + "captures": { + "1": { + "name": "keyword.operator.type.function.swift" + } + } + }, + { + "comment": "Swift 3: A & B", + "match": "(?&|\\^~.])(&)(?![/=\\-+!*%<>&|\\^~.])", + "captures": { + "1": { "name": "keyword.operator.type.composition.swift" - }, - { - "match": "(?<=\\.)(?:Protocol|Type)\\b", - "name": "keyword.operator.type.metatype.swift" - }, - { - "include": "#tuple-type" - }, - { - "include": "#collection-type" - }, - { - "include": "#generic-argument-clause" - } - ], - "repository": { - "collection-type": { - "begin": "\\[", - "beginCaptures": { - "0": { - "name": "punctuation.section.collection-type.begin.swift" - } - }, - "comment": "array and dictionary types [Value] and [Key: Value]", - "end": "\\]|(?=[>){}])", - "endCaptures": { - "0": { - "name": "punctuation.section.collection-type.end.swift" - } - }, - "patterns": [ - { - "include": "#available-types" - }, - { - "begin": ":", - "beginCaptures": { - "0": { - "name": "punctuation.separator.key-value.swift" - } - }, - "end": "(?=\\]|[>){}])", - "patterns": [ - { - "match": ":", - "name": "invalid.illegal.extra-colon-in-dictionary-type.swift" - }, - { - "include": "#available-types" - } - ] - } - ] - }, - "tuple-type": { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.section.tuple-type.begin.swift" - } - }, - "end": "\\)|(?=[>\\]{}])", - "endCaptures": { - "0": { - "name": "punctuation.section.tuple-type.end.swift" - } - }, - "patterns": [ - { - "include": "#available-types" - } - ] } } }, - "extension": { - "begin": "\\b(extension)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", - "beginCaptures": { - "1": { - "name": "storage.type.$1.swift" - }, - "2": { - "name": "entity.name.type.swift", - "patterns": [ - { - "include": "#available-types" - } - ] - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "end": "(?<=\\})", - "name": "meta.definition.type.$1.swift", - "patterns": [ - { - "include": "#comments" - }, - { - "comment": "SE-0143: Conditional Conformances", - "include": "#generic-where-clause" - }, - { - "include": "#inheritance-clause" - }, - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.type.begin.swift" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.type.end.swift" - } - }, - "name": "meta.definition.type.body.swift", - "patterns": [ - { - "include": "$self" - } - ] - } - ] + { + "name": "keyword.operator.type.optional.swift", + "match": "[?!]" }, - "function": { - "begin": "(?x)\n\t\t\t\t\t\t\\b\n\t\t\t\t\t\t(?:(nonisolated)\\s+)?\n\t\t\t\t\t\t(func)\n\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)\n\t\t\t\t\t\t | (?:\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\g\n\t\t\t\t\t\t\t\t\t | (?\t\t\t\t\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)*\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t | ( \\. ( \\g | \\g | \\. )+ )\t\t\t# Dot operators\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t(?=\\(|<)\n\t\t\t\t\t", - "beginCaptures": { - "1": { - "name": "storage.modifier.swift" - }, - "2": { - "name": "storage.type.function.swift" - }, - "3": { - "name": "entity.name.function.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - }, - "5": { - "name": "punctuation.definition.identifier.swift" - } - }, - "end": "(?<=\\})|$(?# functions in protocol declarations or generated interfaces have no body)", - "name": "meta.definition.function.swift", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#generic-parameter-clause" - }, - { - "include": "#parameter-clause" - }, - { - "include": "#function-result" - }, - { - "include": "#async-throws" - }, - { - "comment": "Swift 3: generic constraints after the parameters and return type", - "include": "#generic-where-clause" - }, - { - "begin": "(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.section.function.begin.swift" - } - }, - "end": "(\\})", - "endCaptures": { - "1": { - "name": "punctuation.section.function.end.swift" - } - }, - "name": "meta.definition.function.body.swift", - "patterns": [ - { - "include": "$self" - } - ] - } - ] + { + "name": "keyword.operator.function.variadic-parameter.swift", + "match": "\\.\\.\\." }, - "function-initializer": { - "begin": "(?", + "name": "keyword.other.type.composition.swift", + "match": "\\bprotocol\\b" }, - "function-result": { - "begin": "(?&|\\^~.])(->)(?![/=\\-+!*%<>&|\\^~.])\\s*", - "beginCaptures": { - "1": { - "name": "keyword.operator.function-result.swift" - } - }, - "end": "(?!\\G)(?=\\{|\\bwhere\\b|;)|$", - "name": "meta.function-result.swift", - "patterns": [ - { - "include": "#available-types" - } - ] + { + "name": "keyword.other.type.metatype.swift", + "match": "(?<=\\.)(?:Protocol|Type)\\b" }, - "generic-argument-clause": { - "begin": "<", + { + "include": "#declarations-available-types-tuple-type" + }, + { + "include": "#declarations-available-types-collection-type" + }, + { + "include": "#declarations-generic-argument-clause" + } + ] + }, + "declarations-available-types-collection-type": { + "comment": "array and dictionary types [Value] and [Key: Value]", + "begin": "\\[", + "end": "\\]|(?=[>){}])", + "beginCaptures": { + "0": { + "name": "punctuation.section.collection-type.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.collection-type.end.swift" + } + }, + "patterns": [ + { + "include": "#declarations-available-types" + }, + { + "begin": ":", + "end": "(?=\\]|[>){}])", "beginCaptures": { "0": { - "name": "punctuation.separator.generic-argument-clause.begin.swift" + "name": "punctuation.separator.key-value.swift" + } + }, + "patterns": [ + { + "name": "invalid.illegal.extra-colon-in-dictionary-type.swift", + "match": ":" + }, + { + "include": "#declarations-available-types" + } + ] + } + ] + }, + "declarations-available-types-tuple-type": { + "begin": "\\(", + "end": "\\)|(?=[>\\]{}])", + "beginCaptures": { + "0": { + "name": "punctuation.section.tuple-type.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.tuple-type.end.swift" + } + }, + "patterns": [ + { + "include": "#declarations-available-types" + } + ] + }, + "declarations-extension": { + "name": "meta.definition.type.$1.swift", + "begin": "\\b(extension)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", + "end": "(?<=\\})", + "beginCaptures": { + "1": { + "name": "storage.type.$1.swift" + }, + "2": { + "name": "entity.name.type.swift", + "patterns": [ + { + "include": "#declarations-available-types" + } + ] + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "comment": "SE-0143: Conditional Conformances", + "include": "#declarations-generic-where-clause" + }, + { + "include": "#declarations-inheritance-clause" + }, + { + "name": "meta.definition.type.body.swift", + "begin": "\\{", + "end": "\\}", + "beginCaptures": { + "0": { + "name": "punctuation.definition.type.begin.swift" } }, - "end": ">|(?=[)\\]{}])", "endCaptures": { "0": { - "name": "punctuation.separator.generic-argument-clause.end.swift" + "name": "punctuation.definition.type.end.swift" } }, - "name": "meta.generic-argument-clause.swift", "patterns": [ { - "include": "#available-types" + "include": "$self" } ] + } + ] + }, + "declarations-function": { + "name": "meta.definition.function.swift", + "begin": "(?x)\n\\b\n(func)\n\\s+\n(\n (?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)\n | (?:\n (\n (? # operator-head\n [/=\\-+!*%<>&|^~?]\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n )\n (\n \\g\n | (? # operator-character\n [\\x{0300}-\\x{036F}]\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n )*\n )\n | ( \\. ( \\g | \\g | \\. )+ ) # Dot operators\n )\n)\n\\s*\n(?=\\(|<)", + "end": "(?<=\\})|$(?# functions in protocol declarations or generated interfaces have no body)", + "beginCaptures": { + "1": { + "name": "storage.type.function.swift" }, - "generic-parameter-clause": { - "begin": "<", - "beginCaptures": { - "0": { - "name": "punctuation.separator.generic-parameter-clause.begin.swift" - } - }, - "end": ">|(?=[^\\w\\d:<>\\s,=&`])(?# characters besides these are never valid in a generic param list -- even if it's not really a valid clause, we should stop trying to parse it if we see one of them.)", - "endCaptures": { - "0": { - "name": "punctuation.separator.generic-parameter-clause.end.swift" - } - }, - "name": "meta.generic-parameter-clause.swift", - "patterns": [ - { - "include": "#comments" - }, - { - "comment": "Swift 2: constraints inside the generic param list", - "include": "#generic-where-clause" - }, - { - "captures": { - "1": { - "name": "variable.language.generic-parameter.swift" - } - }, - "match": "\\b((?!\\d)\\w[\\w\\d]*)\\b" - }, - { - "match": ",", - "name": "punctuation.separator.generic-parameters.swift" - }, - { - "begin": "(:)\\s*", - "beginCaptures": { - "1": { - "name": "punctuation.separator.generic-parameter-constraint.swift" - } - }, - "end": "(?=[,>]|(?!\\G)\\bwhere\\b)", - "name": "meta.generic-parameter-constraint.swift", - "patterns": [ - { - "begin": "\\G", - "end": "(?=[,>]|(?!\\G)\\bwhere\\b)", - "name": "entity.other.inherited-class.swift", - "patterns": [ - { - "include": "#type-identifier" - } - ] - } - ] - } - ] + "2": { + "name": "entity.name.function.swift" }, - "generic-where-clause": { - "begin": "\\b(where)\\b\\s*", + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-generic-parameter-clause" + }, + { + "include": "#declarations-parameter-clause" + }, + { + "include": "#declarations-function-result" + }, + { + "include": "#async-throws" + }, + { + "comment": "Swift 3: generic constraints after the parameters and return type", + "include": "#declarations-generic-where-clause" + }, + { + "name": "meta.definition.function.body.swift", + "begin": "(\\{)", + "end": "(\\})", "beginCaptures": { "1": { - "name": "keyword.other.generic-constraint-introducer.swift" + "name": "punctuation.section.function.begin.swift" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.section.function.end.swift" } }, - "end": "(?!\\G)$|(?=[>{};\\n]|//|/\\*)", - "name": "meta.generic-where-clause.swift", "patterns": [ { - "include": "#comments" - }, - { - "include": "#requirement-list" + "include": "$self" } - ], - "repository": { - "requirement-list": { - "begin": "\\G|,\\s*", - "end": "(?=[,>{};\\n]|//|/\\*)", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#constraint" - }, - { - "include": "#available-types" - }, - { - "begin": "(?&|\\^~.])(==)(?![/=\\-+!*%<>&|\\^~.])", - "beginCaptures": { - "1": { - "name": "keyword.operator.generic-constraint.same-type.swift" - } - }, - "end": "(?=\\s*[,>{};\\n]|//|/\\*)", - "name": "meta.generic-where-clause.same-type-requirement.swift", - "patterns": [ - { - "include": "#available-types" - } - ] - }, - { - "begin": "(?&|\\^~.])(:)(?![/=\\-+!*%<>&|\\^~.])", - "beginCaptures": { - "1": { - "name": "keyword.operator.generic-constraint.conforms-to.swift" - } - }, - "end": "(?=\\s*[,>{};\\n]|//|/\\*)", - "name": "meta.generic-where-clause.conformance-requirement.swift", - "patterns": [ - { - "begin": "\\G\\s*", - "contentName": "entity.other.inherited-class.swift", - "end": "(?=\\s*[,>{};\\n]|//|/\\*)", - "patterns": [ - { - "include": "#available-types" - } - ] - } - ] - } - ] + ] + } + ] + }, + "declarations-function-initializer": { + "name": "meta.definition.function.initializer.swift", + "begin": "(?&|\\^~.])(->)(?![/=\\-+!*%<>&|\\^~.])\\s*", + "end": "(?!\\G)(?=\\{|\\bwhere\\b|;|=)|$", + "beginCaptures": { + "1": { + "name": "keyword.operator.function-result.swift" + } + }, + "patterns": [ + { + "include": "#declarations-available-types" + } + ] + }, + "declarations-function-subscript": { + "name": "meta.definition.function.subscript.swift", + "begin": "(?|(?=[)\\]{}])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.generic-argument-clause.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.separator.generic-argument-clause.end.swift" + } + }, + "patterns": [ + { + "include": "#declarations-available-types" + } + ] + }, + "declarations-generic-parameter-clause": { + "name": "meta.generic-parameter-clause.swift", + "begin": "<", + "end": ">|(?=[^\\w\\d:<>\\s,=&`])(?# characters besides these are never valid in a generic param list -- even if it's not really a valid clause, we should stop trying to parse it if we see one of them.)", + "beginCaptures": { + "0": { + "name": "punctuation.separator.generic-parameter-clause.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.separator.generic-parameter-clause.end.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "comment": "Swift 2: constraints inside the generic param list", + "include": "#declarations-generic-where-clause" + }, + { + "name": "keyword.control.loop.swift", + "match": "\\beach\\b" + }, + { + "match": "\\b((?!\\d)\\w[\\w\\d]*)\\b", + "captures": { + "1": { + "name": "variable.language.generic-parameter.swift" } } }, - "import": { - "begin": "(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)\n\t\t\t\t\t\t\t\t\t", - "name": "entity.name.type.swift" - }, - { - "match": "(?x)\n\t\t\t\t\t\t\t\t\t\t(?<=\\G|\\.)\n\t\t\t\t\t\t\t\t\t\t\\$[0-9]+\n\t\t\t\t\t\t\t\t\t", - "name": "entity.name.type.swift" - }, - { - "captures": { - "1": { - "patterns": [ - { - "match": "\\.", - "name": "invalid.illegal.dot-not-allowed-here.swift" - } - ] - } - }, - "match": "(?x)\n\t\t\t\t\t\t\t\t\t\t(?<=\\G|\\.)\n\t\t\t\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t(?\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\g\n\t\t\t\t\t\t\t\t\t\t\t\t | (?\t\t\t\t\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)*\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t | ( \\. ( \\g | \\g | \\. )+ )\t\t\t# Dot operators\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t(?=\\.|;|$|//|/\\*|\\s)\n\t\t\t\t\t\t\t\t\t", - "name": "entity.name.type.swift" - }, - { - "match": "\\.", - "name": "punctuation.separator.import.swift" - }, - { - "begin": "(?!\\s*(;|$|//|/\\*))", - "end": "(?=\\s*(;|$|//|/\\*))", - "name": "invalid.illegal.character-not-allowed-here.swift" - } - ] - } - ] + { + "name": "punctuation.separator.generic-parameters.swift", + "match": "," }, - "inheritance-clause": { - "begin": "(:)(?=\\s*\\{)|(:)\\s*", + { + "name": "meta.generic-parameter-constraint.swift", + "begin": "(:)\\s*", + "end": "(?=[,>]|(?!\\G)\\bwhere\\b)", "beginCaptures": { "1": { - "name": "invalid.illegal.empty-inheritance-clause.swift" - }, - "2": { - "name": "punctuation.separator.inheritance-clause.swift" + "name": "punctuation.separator.generic-parameter-constraint.swift" } }, - "end": "(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)", - "name": "meta.inheritance-clause.swift", "patterns": [ { - "begin": "\\bclass\\b", - "beginCaptures": { - "0": { - "name": "storage.type.class.swift" - } - }, - "end": "(?=[={}]|(?!\\G)\\bwhere\\b)", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#more-types" - } - ] - }, - { - "begin": "\\G", - "end": "(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#inherited-type" - }, - { - "include": "#more-types" - } - ] - } - ], - "repository": { - "inherited-type": { - "begin": "(?=[`\\p{L}_])", - "end": "(?!\\G)", "name": "entity.other.inherited-class.swift", + "begin": "\\G", + "end": "(?=[,>]|(?!\\G)\\bwhere\\b)", "patterns": [ { - "include": "#type-identifier" - } - ] - }, - "more-types": { - "begin": ",\\s*", - "end": "(?!\\G)(?!//|/\\*)|(?=[,={}]|(?!\\G)\\bwhere\\b)", - "name": "meta.inheritance-list.more-types", - "patterns": [ - { - "include": "#comments" + "include": "#declarations-type-identifier" }, { - "include": "#inherited-type" - }, - { - "include": "#more-types" + "include": "#declarations-type-operators" } ] } - } + ] + } + ] + }, + "declarations-generic-where-clause": { + "name": "meta.generic-where-clause.swift", + "begin": "\\b(where)\\b\\s*", + "end": "(?!\\G)$|(?=[>{};\\n]|//|/\\*)", + "beginCaptures": { + "1": { + "name": "keyword.other.generic-constraint-introducer.swift" + } + }, + "patterns": [ + { + "include": "#comments" }, - "operator": { - "begin": "(?x)\n\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\\b(prefix|infix|postfix)\n\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t)?\n\t\t\t\t\t\t\\b\n\t\t\t\t\t\t(operator)\n\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(?\t\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\\g\n\t\t\t\t\t\t\t\t | \\.\t\t\t\t\t\t\t\t\t# Invalid dot\n\t\t\t\t\t\t\t\t | (?\t\t\t\t\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)*+\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t | ( \\. ( \\g | \\g | \\. )++ )\t\t\t# Dot operators\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t", + { + "include": "#declarations-generic-where-clause-requirement-list" + } + ] + }, + "declarations-generic-where-clause-requirement-list": { + "begin": "\\G|,\\s*", + "end": "(?=[,>{};\\n]|//|/\\*)", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#constraint" + }, + { + "include": "#declarations-available-types" + }, + { + "name": "meta.generic-where-clause.same-type-requirement.swift", + "begin": "(?&|\\^~.])(==)(?![/=\\-+!*%<>&|\\^~.])", + "end": "(?=\\s*[,>{};\\n]|//|/\\*)", "beginCaptures": { + "1": { + "name": "keyword.operator.generic-constraint.same-type.swift" + } + }, + "patterns": [ + { + "include": "#declarations-available-types" + } + ] + }, + { + "name": "meta.generic-where-clause.conformance-requirement.swift", + "begin": "(?&|\\^~.])(:)(?![/=\\-+!*%<>&|\\^~.])", + "end": "(?=\\s*[,>{};\\n]|//|/\\*)", + "beginCaptures": { + "1": { + "name": "keyword.operator.generic-constraint.conforms-to.swift" + } + }, + "patterns": [ + { + "contentName": "entity.other.inherited-class.swift", + "begin": "\\G\\s*", + "end": "(?=\\s*[,>{};\\n]|//|/\\*)", + "patterns": [ + { + "include": "#declarations-available-types" + } + ] + } + ] + } + ] + }, + "declarations-import": { + "name": "meta.import.swift", + "begin": "(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)", + "captures": { + "1": { + "name": "punctuation.definition.identifier.swift" + }, + "2": { + "name": "punctuation.definition.identifier.swift" + } + } + }, + { + "name": "entity.name.type.swift", + "match": "(?x)\n(?<=\\G|\\.)\n\\$[0-9]+" + }, + { + "name": "entity.name.type.swift", + "match": "(?x)\n(?<=\\G|\\.)\n(?:\n (\n (? # operator-head\n [/=\\-+!*%<>&|^~?]\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n )\n (\n \\g\n | (? # operator-character\n [\\x{0300}-\\x{036F}]\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n )*\n )\n | ( \\. ( \\g | \\g | \\. )+ ) # Dot operators\n)\n(?=\\.|;|$|//|/\\*|\\s)", + "captures": { + "1": { + "patterns": [ + { + "name": "invalid.illegal.dot-not-allowed-here.swift", + "match": "\\." + } + ] + } + } + }, + { + "name": "punctuation.separator.import.swift", + "match": "\\." + }, + { + "name": "invalid.illegal.character-not-allowed-here.swift", + "begin": "(?!\\s*(;|$|//|/\\*))", + "end": "(?=\\s*(;|$|//|/\\*))" + } + ] + } + ] + }, + "declarations-inheritance-clause": { + "name": "meta.inheritance-clause.swift", + "begin": "(:)(?=\\s*\\{)|(:)\\s*", + "end": "(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)", + "beginCaptures": { + "1": { + "name": "invalid.illegal.empty-inheritance-clause.swift" + }, + "2": { + "name": "punctuation.separator.inheritance-clause.swift" + } + }, + "patterns": [ + { + "begin": "\\bclass\\b", + "end": "(?=[={}]|(?!\\G)\\bwhere\\b)", + "beginCaptures": { + "0": { + "name": "storage.type.class.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-inheritance-clause-more-types" + } + ] + }, + { + "begin": "\\G", + "end": "(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-inheritance-clause-inherited-type" + }, + { + "include": "#declarations-inheritance-clause-more-types" + }, + { + "include": "#declarations-type-operators" + } + ] + } + ] + }, + "declarations-inheritance-clause-inherited-type": { + "name": "entity.other.inherited-class.swift", + "begin": "(?=[`\\p{L}_])", + "end": "(?!\\G)", + "patterns": [ + { + "include": "#declarations-type-identifier" + } + ] + }, + "declarations-inheritance-clause-more-types": { + "name": "meta.inheritance-list.more-types", + "begin": ",\\s*", + "end": "(?!\\G)(?!//|/\\*)|(?=[,={}]|(?!\\G)\\bwhere\\b)", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-inheritance-clause-inherited-type" + }, + { + "include": "#declarations-inheritance-clause-more-types" + }, + { + "include": "#declarations-type-operators" + } + ] + }, + "declarations-macro": { + "name": "meta.definition.macro.swift", + "begin": "(?x)\n\\b\n(macro)\n\\s+\n((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\n\\s*\n(?=\\(|<|=)", + "end": "$|(?=;|//|/\\*|\\}|=)", + "beginCaptures": { + "1": { + "name": "storage.type.function.swift" + }, + "2": { + "name": "entity.name.function.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-generic-parameter-clause" + }, + { + "include": "#declarations-parameter-clause" + }, + { + "include": "#declarations-function-result" + }, + { + "include": "#async-throws" + }, + { + "comment": "Swift 3: generic constraints after the parameters and return type", + "include": "#declarations-generic-where-clause" + } + ] + }, + "declarations-operator": { + "name": "meta.definition.operator.swift", + "begin": "(?x)\n(?:\n \\b(prefix|infix|postfix)\n \\s+\n)?\n\\b\n(operator)\n\\s+\n(\n (\n (? # operator-head\n [/=\\-+!*%<>&|^~?]\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n )\n (\n \\g\n | \\. # Invalid dot\n | (? # operator-character\n [\\x{0300}-\\x{036F}]\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n )*+\n )\n | ( \\. ( \\g | \\g | \\. )++ ) # Dot operators\n)\n\\s*", + "end": "(;)|$\\n?|(?=//|/\\*)", + "beginCaptures": { + "1": { + "name": "storage.modifier.swift" + }, + "2": { + "name": "storage.type.function.operator.swift" + }, + "3": { + "name": "entity.name.function.operator.swift" + }, + "4": { + "comment": "workaround for https://github.com/microsoft/vscode-textmate/issues/140#issuecomment-1793610346", + "name": "entity.name.function.operator.swift", + "patterns": [ + { + "name": "invalid.illegal.dot-not-allowed-here.swift", + "match": "\\." + } + ] + } + }, + "endCaptures": { + "1": { + "name": "punctuation.terminator.statement.swift" + } + }, + "patterns": [ + { + "include": "#declarations-operator-swift2" + }, + { + "include": "#declarations-operator-swift3" + }, + { + "name": "invalid.illegal.character-not-allowed-here.swift", + "match": "((?!$|;|//|/\\*)\\S)+" + } + ] + }, + "declarations-operator-swift2": { + "begin": "\\G(\\{)", + "end": "(\\})", + "beginCaptures": { + "1": { + "name": "punctuation.definition.operator.begin.swift" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.definition.operator.end.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "match": "\\b(associativity)\\s+(left|right)\\b", + "captures": { "1": { "name": "storage.modifier.swift" }, "2": { - "name": "storage.type.function.operator.swift" - }, - "3": { - "name": "entity.name.function.operator.swift" - }, - "4": { - "patterns": [ - { - "match": "\\.", - "name": "invalid.illegal.dot-not-allowed-here.swift" - } - ] - } - }, - "end": "(;)|$\\n?|(?=//|/\\*)", - "endCaptures": { - "1": { - "name": "punctuation.terminator.statement.swift" - } - }, - "name": "meta.definition.operator.swift", - "patterns": [ - { - "include": "#swift2" - }, - { - "include": "#swift3" - }, - { - "match": "((?!$|;|//|/\\*)\\S)+", - "name": "invalid.illegal.character-not-allowed-here.swift" - } - ], - "repository": { - "swift2": { - "begin": "\\G(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.operator.begin.swift" - } - }, - "end": "(\\})", - "endCaptures": { - "1": { - "name": "punctuation.definition.operator.end.swift" - } - }, - "patterns": [ - { - "include": "#comments" - }, - { - "captures": { - "1": { - "name": "storage.modifier.swift" - }, - "2": { - "name": "keyword.other.operator.associativity.swift" - } - }, - "match": "\\b(associativity)\\s+(left|right)\\b" - }, - { - "captures": { - "1": { - "name": "storage.modifier.swift" - }, - "2": { - "name": "constant.numeric.integer.swift" - } - }, - "match": "\\b(precedence)\\s+([0-9]+)\\b" - }, - { - "captures": { - "1": { - "name": "storage.modifier.swift" - } - }, - "match": "\\b(assignment)\\b" - } - ] - }, - "swift3": { - "captures": { - "2": { - "name": "entity.other.inherited-class.swift", - "patterns": [ - { - "include": "#types-precedencegroup" - } - ] - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "match": "\\G(:)\\s*((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))" + "name": "keyword.other.operator.associativity.swift" } } }, - "parameter-clause": { - "begin": "(\\()", - "beginCaptures": { + { + "match": "\\b(precedence)\\s+([0-9]+)\\b", + "captures": { "1": { - "name": "punctuation.definition.parameters.begin.swift" - } - }, - "end": "(\\))(?:\\s*(async)\\b)?", - "endCaptures": { - "1": { - "name": "punctuation.definition.parameters.end.swift" + "name": "storage.modifier.swift" }, "2": { - "name": "keyword.control.async.swift" - } - }, - "name": "meta.parameter-clause.swift", - "patterns": [ - { - "include": "#parameter-list" - } - ] - }, - "parameter-list": { - "patterns": [ - { - "captures": { - "1": { - "name": "entity.name.function.swift" - }, - "2": { - "name": "punctuation.definition.identifier.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "variable.parameter.function.swift" - }, - "5": { - "name": "punctuation.definition.identifier.swift" - }, - "6": { - "name": "punctuation.definition.identifier.swift" - } - }, - "comment": "External parameter labels are considered part of the function name", - "match": "((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))(?=\\s*:)" - }, - { - "captures": { - "1": { - "name": "variable.parameter.function.swift" - }, - "2": { - "name": "entity.name.function.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "comment": "If no external label is given, the name is both the external label and the internal variable name", - "match": "(((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)))(?=\\s*:)" - }, - { - "begin": ":\\s*(?!\\s)", - "end": "(?=[,)])", - "patterns": [ - { - "include": "#available-types" - }, - { - "match": ":", - "name": "invalid.illegal.extra-colon-in-parameter-list.swift" - }, - { - "begin": "=", - "beginCaptures": { - "0": { - "name": "keyword.operator.assignment.swift" - } - }, - "comment": "a parameter's default value", - "end": "(?=[,)])", - "patterns": [ - { - "include": "#expressions" - } - ] - } - ] - } - ] - }, - "precedencegroup": { - "begin": "\\b(precedencegroup)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*(?=\\{)", - "beginCaptures": { - "1": { - "name": "storage.type.precedencegroup.swift" - }, - "2": { - "name": "entity.name.type.precedencegroup.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "end": "(?!\\G)", - "name": "meta.definition.precedencegroup.swift", - "patterns": [ - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.precedencegroup.begin.swift" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.precedencegroup.end.swift" - } - }, - "patterns": [ - { - "include": "#comments" - }, - { - "captures": { - "1": { - "name": "storage.modifier.swift" - }, - "2": { - "name": "entity.other.inherited-class.swift", - "patterns": [ - { - "include": "#types-precedencegroup" - } - ] - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "match": "\\b(higherThan|lowerThan)\\s*:\\s*((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))" - }, - { - "captures": { - "1": { - "name": "storage.modifier.swift" - }, - "2": { - "name": "keyword.other.operator.associativity.swift" - } - }, - "match": "\\b(associativity)\\b(?:\\s*:\\s*(right|left|none)\\b)?" - }, - { - "captures": { - "1": { - "name": "storage.modifier.swift" - }, - "2": { - "name": "constant.language.boolean.swift" - } - }, - "match": "\\b(assignment)\\b(?:\\s*:\\s*(true|false)\\b)?" - } - ] - } - ] - }, - "protocol": { - "begin": "\\b(protocol)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", - "beginCaptures": { - "1": { - "name": "storage.type.$1.swift" - }, - "2": { - "name": "entity.name.type.$1.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "end": "(?<=\\})", - "name": "meta.definition.type.protocol.swift", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#inheritance-clause" - }, - { - "comment": "SE-0142: Permit where clauses to constrain associated types", - "include": "#generic-where-clause" - }, - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.type.begin.swift" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.type.end.swift" - } - }, - "name": "meta.definition.type.body.swift", - "patterns": [ - { - "include": "#protocol-method" - }, - { - "include": "#protocol-initializer" - }, - { - "include": "#associated-type" - }, - { - "include": "$self" - } - ] - } - ], - "repository": { - "associated-type": { - "begin": "\\b(associatedtype)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*", - "beginCaptures": { - "1": { - "name": "keyword.other.declaration-specifier.swift" - }, - "2": { - "name": "variable.language.associatedtype.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "end": "(?!\\G)$|(?=[;}]|$)", - "name": "meta.definition.associatedtype.swift", - "patterns": [ - { - "include": "#inheritance-clause" - }, - { - "comment": "SE-0142: Permit where clauses to constrain associated types", - "include": "#generic-where-clause" - }, - { - "include": "#typealias-assignment" - } - ] - }, - "protocol-initializer": { - "begin": "(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)\n\t\t \t\t\t\t\t\t | (?:\n\t\t \t\t\t\t\t\t\t\t(\n\t\t \t\t\t\t\t\t\t\t\t(?\t\t\t\t\t\t\t\t# operator-head\n\t\t \t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t \t\t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t\t\t(\n\t\t \t\t\t\t\t\t\t\t\t\t\\g\n\t\t \t\t\t\t\t\t\t\t\t | (?\t\t\t\t\t\t\t\t# operator-character\n\t\t \t\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t \t\t\t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t\t\t)*\n\t\t \t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t | ( \\. ( \\g | \\g | \\. )+ )\t\t\t# Dot operators\n\t\t \t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t(?=\\(|<)\n\t\t\t\t\t\t\t", - "beginCaptures": { - "1": { - "name": "storage.type.function.swift" - }, - "2": { - "name": "entity.name.function.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "end": "$|(?=;|//|/\\*|\\})", - "name": "meta.definition.function.swift", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#generic-parameter-clause" - }, - { - "include": "#parameter-clause" - }, - { - "include": "#function-result" - }, - { - "include": "#async-throws" - }, - { - "comment": "Swift 3: generic constraints after the parameters and return type", - "include": "#generic-where-clause" - }, - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.section.function.begin.swift" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.section.function.end.swift" - } - }, - "name": "invalid.illegal.function-body-not-allowed-in-protocol.swift", - "patterns": [ - { - "include": "$self" - } - ] - } - ] + "name": "constant.numeric.integer.swift" } } }, - "type": { - "patterns": [ - { - "begin": "\\b(class(?!\\s+(?:func|var|let)\\b)|struct|actor)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", - "beginCaptures": { - "1": { - "name": "storage.type.$1.swift" - }, - "2": { - "name": "entity.name.type.$1.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "end": "(?<=\\})", - "name": "meta.definition.type.$1.swift", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#generic-parameter-clause" - }, - { - "comment": "Swift 3: generic constraints after the generic param list", - "include": "#generic-where-clause" - }, - { - "include": "#inheritance-clause" - }, - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.type.begin.swift" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.type.end.swift" - } - }, - "name": "meta.definition.type.body.swift", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - { - "include": "#type-enum" - } - ] - }, - "type-enum": { - "begin": "\\b(enum)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", - "beginCaptures": { + { + "match": "\\b(assignment)\\b", + "captures": { "1": { - "name": "storage.type.$1.swift" - }, - "2": { - "name": "entity.name.type.$1.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "end": "(?<=\\})", - "name": "meta.definition.type.$1.swift", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#generic-parameter-clause" - }, - { - "comment": "Swift 3: generic constraints after the generic param list", - "include": "#generic-where-clause" - }, - { - "include": "#inheritance-clause" - }, - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.type.begin.swift" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.type.end.swift" - } - }, - "name": "meta.definition.type.body.swift", - "patterns": [ - { - "include": "#enum-case-clause" - }, - { - "include": "$self" - } - ] - } - ], - "repository": { - "associated-values": { - "begin": "\\G\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.parameters.begin.swift" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.parameters.end.swift" - } - }, - "patterns": [ - { - "include": "#comments" - }, - { - "begin": "(?x)\n\t\t\t\t\t\t\t\t\t\t(?:(_)|((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k))\n\t\t\t\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t\t\t\t\t(((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k))\n\t\t\t\t\t\t\t\t\t\t\\s*(:)", - "beginCaptures": { - "1": { - "name": "entity.name.function.swift" - }, - "2": { - "name": "invalid.illegal.distinct-labels-not-allowed.swift" - }, - "5": { - "name": "variable.parameter.function.swift" - }, - "7": { - "name": "punctuation.separator.argument-label.swift" - } - }, - "end": "(?=[,)\\]])", - "patterns": [ - { - "include": "#available-types" - } - ] - }, - { - "begin": "(((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k))\\s*(:)", - "beginCaptures": { - "1": { - "name": "entity.name.function.swift" - }, - "2": { - "name": "variable.parameter.function.swift" - }, - "4": { - "name": "punctuation.separator.argument-label.swift" - } - }, - "end": "(?=[,)\\]])", - "patterns": [ - { - "include": "#available-types" - } - ] - }, - { - "begin": "(?![,)\\]])(?=\\S)", - "comment": "an element without a label (i.e. anything else)", - "end": "(?=[,)\\]])", - "patterns": [ - { - "include": "#available-types" - }, - { - "match": ":", - "name": "invalid.illegal.extra-colon-in-parameter-list.swift" - } - ] - } - ] - }, - "enum-case": { - "begin": "(?x)((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*", - "beginCaptures": { - "1": { - "name": "constant.other.swift" - } - }, - "end": "(?<=\\))|(?![=(])", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#associated-values" - }, - { - "include": "#raw-value-assignment" - } - ] - }, - "enum-case-clause": { - "begin": "\\b(case)\\b\\s*", - "beginCaptures": { - "1": { - "name": "storage.type.enum.case.swift" - } - }, - "end": "(?=[;}])|(?!\\G)(?!//|/\\*)(?=[^\\s,])", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#enum-case" - }, - { - "include": "#more-cases" - } - ] - }, - "more-cases": { - "begin": ",\\s*", - "end": "(?!\\G)(?!//|/\\*)(?=[;}]|[^\\s,])", - "name": "meta.enum-case.more-cases", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#enum-case" - }, - { - "include": "#more-cases" - } - ] - }, - "raw-value-assignment": { - "begin": "(=)\\s*", - "beginCaptures": { - "1": { - "name": "keyword.operator.assignment.swift" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#literals" - } - ] + "name": "storage.modifier.swift" } } - }, - "type-identifier": { - "begin": "((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*", - "beginCaptures": { - "1": { - "name": "meta.type-name.swift", - "patterns": [ - { - "include": "#builtin-types" - } - ] - }, - "2": { - "name": "punctuation.definition.identifier.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - } - }, - "end": "(?!<)", + } + ] + }, + "declarations-operator-swift3": { + "match": "\\G(:)\\s*((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", + "captures": { + "2": { + "name": "entity.other.inherited-class.swift", "patterns": [ { - "begin": "(?=<)", - "end": "(?!\\G)", - "patterns": [ - { - "include": "#generic-argument-clause" - } - ] + "include": "#declarations-types-precedencegroup" } ] }, - "typealias": { - "begin": "\\b(typealias)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*", - "beginCaptures": { - "1": { - "name": "keyword.other.declaration-specifier.swift" - }, - "2": { - "name": "entity.name.type.typealias.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.identifier.swift" - } - }, - "end": "(?!\\G)$|(?=;|//|/\\*|$)", - "name": "meta.definition.typealias.swift", - "patterns": [ - { - "begin": "\\G(?=<)", - "end": "(?!\\G)", - "patterns": [ - { - "include": "#generic-parameter-clause" - } - ] - }, - { - "include": "#typealias-assignment" - } - ] + "3": { + "name": "punctuation.definition.identifier.swift" }, - "typealias-assignment": { - "begin": "(=)\\s*", - "beginCaptures": { - "1": { - "name": "keyword.operator.assignment.swift" - } - }, - "end": "(?!\\G)$|(?=;|//|/\\*|$)", - "patterns": [ - { - "include": "#available-types" - } - ] - }, - "typed-variable-declaration": { - "begin": "(?x)\n\t\t\t\t\t\t\\b(?:(async)\\s+)?(let|var)\\b\\s+\n\t\t\t\t\t\t(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)\\s*\n\t\t\t\t\t\t:\n\t\t\t\t\t", - "beginCaptures": { - "1": { - "name": "keyword.control.async.swift" - }, - "2": { - "name": "keyword.other.declaration-specifier.swift" - } - }, - "end": "(?=$|[={])", - "patterns": [ - { - "include": "#available-types" - } - ] - }, - "types-precedencegroup": { - "patterns": [ - { - "comment": "Precedence groups in the standard library", - "match": "\\b(?:BitwiseShift|Assignment|RangeFormation|Casting|Addition|NilCoalescing|Comparison|LogicalConjunction|LogicalDisjunction|Default|Ternary|Multiplication|FunctionArrow)Precedence\\b", - "name": "support.type.swift" - } - ] + "4": { + "name": "punctuation.definition.identifier.swift" } } }, + "declarations-parameter-clause": { + "name": "meta.parameter-clause.swift", + "begin": "(\\()", + "end": "(\\))(?:\\s*(async)\\b)?", + "beginCaptures": { + "1": { + "name": "punctuation.definition.parameters.begin.swift" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.definition.parameters.end.swift" + }, + "2": { + "name": "storage.modifier.async.swift" + } + }, + "patterns": [ + { + "include": "#declarations-parameter-list" + } + ] + }, + "declarations-parameter-list": { + "patterns": [ + { + "comment": "External parameter labels are considered part of the function name", + "match": "((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))(?=\\s*:)", + "captures": { + "1": { + "name": "entity.name.function.swift" + }, + "2": { + "name": "punctuation.definition.identifier.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "variable.parameter.function.swift" + }, + "5": { + "name": "punctuation.definition.identifier.swift" + }, + "6": { + "name": "punctuation.definition.identifier.swift" + } + } + }, + { + "comment": "If no external label is given, the name is both the external label and the internal variable name", + "match": "(((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)))(?=\\s*:)", + "captures": { + "1": { + "name": "variable.parameter.function.swift" + }, + "2": { + "name": "entity.name.function.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + } + }, + { + "begin": ":\\s*(?!\\s)", + "end": "(?=[,)])", + "patterns": [ + { + "include": "#declarations-available-types" + }, + { + "name": "invalid.illegal.extra-colon-in-parameter-list.swift", + "match": ":" + }, + { + "comment": "a parameter's default value", + "begin": "=", + "end": "(?=[,)])", + "beginCaptures": { + "0": { + "name": "keyword.operator.assignment.swift" + } + }, + "patterns": [ + { + "include": "#expressions" + } + ] + } + ] + } + ] + }, + "declarations-precedencegroup": { + "name": "meta.definition.precedencegroup.swift", + "begin": "\\b(precedencegroup)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*(?=\\{)", + "end": "(?!\\G)", + "beginCaptures": { + "1": { + "name": "storage.type.precedencegroup.swift" + }, + "2": { + "name": "entity.name.type.precedencegroup.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "begin": "\\{", + "end": "\\}", + "beginCaptures": { + "0": { + "name": "punctuation.definition.precedencegroup.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.precedencegroup.end.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "match": "\\b(higherThan|lowerThan)\\s*:\\s*((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", + "captures": { + "1": { + "name": "storage.modifier.swift" + }, + "2": { + "name": "entity.other.inherited-class.swift", + "patterns": [ + { + "include": "#declarations-types-precedencegroup" + } + ] + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + } + }, + { + "match": "\\b(associativity)\\b(?:\\s*:\\s*(right|left|none)\\b)?", + "captures": { + "1": { + "name": "storage.modifier.swift" + }, + "2": { + "name": "keyword.other.operator.associativity.swift" + } + } + }, + { + "match": "\\b(assignment)\\b(?:\\s*:\\s*(true|false)\\b)?", + "captures": { + "1": { + "name": "storage.modifier.swift" + }, + "2": { + "name": "constant.language.boolean.swift" + } + } + } + ] + } + ] + }, + "declarations-protocol": { + "name": "meta.definition.type.protocol.swift", + "begin": "\\b(protocol)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", + "end": "(?<=\\})", + "beginCaptures": { + "1": { + "name": "storage.type.$1.swift" + }, + "2": { + "name": "entity.name.type.$1.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-inheritance-clause" + }, + { + "comment": "SE-0142: Permit where clauses to constrain associated types", + "include": "#declarations-generic-where-clause" + }, + { + "name": "meta.definition.type.body.swift", + "begin": "\\{", + "end": "\\}", + "beginCaptures": { + "0": { + "name": "punctuation.definition.type.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.type.end.swift" + } + }, + "patterns": [ + { + "include": "#declarations-protocol-protocol-method" + }, + { + "include": "#declarations-protocol-protocol-initializer" + }, + { + "include": "#declarations-protocol-associated-type" + }, + { + "include": "$self" + } + ] + } + ] + }, + "declarations-protocol-associated-type": { + "name": "meta.definition.associatedtype.swift", + "begin": "\\b(associatedtype)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*", + "end": "(?!\\G)$|(?=[;}]|$)", + "beginCaptures": { + "1": { + "name": "keyword.other.declaration-specifier.swift" + }, + "2": { + "name": "variable.language.associatedtype.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "include": "#declarations-inheritance-clause" + }, + { + "comment": "SE-0142: Permit where clauses to constrain associated types", + "include": "#declarations-generic-where-clause" + }, + { + "include": "#declarations-typealias-assignment" + } + ] + }, + "declarations-protocol-protocol-initializer": { + "name": "meta.definition.function.initializer.swift", + "begin": "(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)\n | (?:\n (\n (? # operator-head\n [/=\\-+!*%<>&|^~?]\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n )\n (\n \\g\n | (? # operator-character\n [\\x{0300}-\\x{036F}]\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n )*\n )\n | ( \\. ( \\g | \\g | \\. )+ ) # Dot operators\n )\n )\n\\s*\n(?=\\(|<)", + "end": "$|(?=;|//|/\\*|\\})", + "beginCaptures": { + "1": { + "name": "storage.type.function.swift" + }, + "2": { + "name": "entity.name.function.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-generic-parameter-clause" + }, + { + "include": "#declarations-parameter-clause" + }, + { + "include": "#declarations-function-result" + }, + { + "include": "#async-throws" + }, + { + "comment": "Swift 3: generic constraints after the parameters and return type", + "include": "#declarations-generic-where-clause" + }, + { + "name": "invalid.illegal.function-body-not-allowed-in-protocol.swift", + "begin": "\\{", + "end": "\\}", + "beginCaptures": { + "0": { + "name": "punctuation.section.function.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.function.end.swift" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + } + ] + }, + "declarations-type": { + "patterns": [ + { + "name": "meta.definition.type.$1.swift", + "begin": "\\b(class(?!\\s+(?:func|var|let)\\b)|struct|actor)\\b\\s*((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", + "end": "(?<=\\})", + "beginCaptures": { + "1": { + "name": "storage.type.$1.swift" + }, + "2": { + "name": "entity.name.type.$1.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-generic-parameter-clause" + }, + { + "comment": "Swift 3: generic constraints after the generic param list", + "include": "#declarations-generic-where-clause" + }, + { + "include": "#declarations-inheritance-clause" + }, + { + "name": "meta.definition.type.body.swift", + "begin": "\\{", + "end": "\\}", + "beginCaptures": { + "0": { + "name": "punctuation.definition.type.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.type.end.swift" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + } + ] + }, + { + "include": "#declarations-type-enum" + } + ] + }, + "declarations-type-enum": { + "name": "meta.definition.type.$1.swift", + "begin": "\\b(enum)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", + "end": "(?<=\\})", + "beginCaptures": { + "1": { + "name": "storage.type.$1.swift" + }, + "2": { + "name": "entity.name.type.$1.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-generic-parameter-clause" + }, + { + "comment": "Swift 3: generic constraints after the generic param list", + "include": "#declarations-generic-where-clause" + }, + { + "include": "#declarations-inheritance-clause" + }, + { + "name": "meta.definition.type.body.swift", + "begin": "\\{", + "end": "\\}", + "beginCaptures": { + "0": { + "name": "punctuation.definition.type.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.type.end.swift" + } + }, + "patterns": [ + { + "include": "#declarations-type-enum-enum-case-clause" + }, + { + "include": "$self" + } + ] + } + ] + }, + "declarations-type-enum-associated-values": { + "begin": "\\G\\(", + "end": "\\)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.parameters.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "begin": "(?x)\n(?:(_)|((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k))\n\\s+\n(((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k))\n\\s*(:)", + "end": "(?=[,)\\]])", + "beginCaptures": { + "1": { + "name": "entity.name.function.swift" + }, + "2": { + "name": "invalid.illegal.distinct-labels-not-allowed.swift" + }, + "5": { + "name": "variable.parameter.function.swift" + }, + "7": { + "name": "punctuation.separator.argument-label.swift" + } + }, + "patterns": [ + { + "include": "#declarations-available-types" + } + ] + }, + { + "begin": "(((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k))\\s*(:)", + "end": "(?=[,)\\]])", + "beginCaptures": { + "1": { + "name": "entity.name.function.swift" + }, + "2": { + "name": "variable.parameter.function.swift" + }, + "4": { + "name": "punctuation.separator.argument-label.swift" + } + }, + "patterns": [ + { + "include": "#declarations-available-types" + } + ] + }, + { + "comment": "an element without a label (i.e. anything else)", + "begin": "(?![,)\\]])(?=\\S)", + "end": "(?=[,)\\]])", + "patterns": [ + { + "include": "#declarations-available-types" + }, + { + "name": "invalid.illegal.extra-colon-in-parameter-list.swift", + "match": ":" + } + ] + } + ] + }, + "declarations-type-enum-enum-case": { + "begin": "(?x)((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*", + "end": "(?<=\\))|(?![=(])", + "beginCaptures": { + "1": { + "name": "variable.other.enummember.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-type-enum-associated-values" + }, + { + "include": "#declarations-type-enum-raw-value-assignment" + } + ] + }, + "declarations-type-enum-enum-case-clause": { + "begin": "\\b(case)\\b\\s*", + "end": "(?=[;}])|(?!\\G)(?!//|/\\*)(?=[^\\s,])", + "beginCaptures": { + "1": { + "name": "storage.type.enum.case.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-type-enum-enum-case" + }, + { + "include": "#declarations-type-enum-more-cases" + } + ] + }, + "declarations-type-enum-more-cases": { + "name": "meta.enum-case.more-cases", + "begin": ",\\s*", + "end": "(?!\\G)(?!//|/\\*)(?=[;}]|[^\\s,])", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#declarations-type-enum-enum-case" + }, + { + "include": "#declarations-type-enum-more-cases" + } + ] + }, + "declarations-type-enum-raw-value-assignment": { + "begin": "(=)\\s*", + "end": "(?!\\G)", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.swift" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#literals" + } + ] + }, + "declarations-type-identifier": { + "begin": "((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*", + "end": "(?!<)", + "beginCaptures": { + "1": { + "name": "meta.type-name.swift", + "patterns": [ + { + "include": "#builtin-types" + } + ] + }, + "2": { + "name": "punctuation.definition.identifier.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "begin": "(?=<)", + "end": "(?!\\G)", + "patterns": [ + { + "include": "#declarations-generic-argument-clause" + } + ] + } + ] + }, + "declarations-type-operators": { + "patterns": [ + { + "comment": "Swift 3: A & B", + "match": "(?&|\\^~.])(&)(?![/=\\-+!*%<>&|\\^~.])", + "captures": { + "1": { + "name": "keyword.operator.type.composition.swift" + } + } + }, + { + "comment": "SE-0390: Noncopyable structs and enums", + "match": "(?&|\\^~.])(~)(?![/=\\-+!*%<>&|\\^~.])", + "captures": { + "1": { + "name": "keyword.operator.type.requirement-suppression.swift" + } + } + } + ] + }, + "declarations-typealias": { + "name": "meta.definition.typealias.swift", + "begin": "\\b(typealias)\\s+((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*", + "end": "(?!\\G)$|(?=;|//|/\\*|$)", + "beginCaptures": { + "1": { + "name": "keyword.other.declaration-specifier.swift" + }, + "2": { + "name": "entity.name.type.typealias.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.identifier.swift" + } + }, + "patterns": [ + { + "begin": "\\G(?=<)", + "end": "(?!\\G)", + "patterns": [ + { + "include": "#declarations-generic-parameter-clause" + } + ] + }, + { + "include": "#declarations-typealias-assignment" + } + ] + }, + "declarations-typealias-assignment": { + "begin": "(=)\\s*", + "end": "(?!\\G)$|(?=;|//|/\\*|$)", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.swift" + } + }, + "patterns": [ + { + "include": "#declarations-available-types" + } + ] + }, + "declarations-typed-variable-declaration": { + "begin": "(?x)\n\\b(?:(async)\\s+)?(let|var)\\b\\s+\n(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)\\s*\n:", + "end": "(?=$|[={])", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.swift" + }, + "2": { + "name": "keyword.other.declaration-specifier.swift" + } + }, + "patterns": [ + { + "include": "#declarations-available-types" + } + ] + }, + "declarations-types-precedencegroup": { + "patterns": [ + { + "comment": "Precedence groups in the standard library", + "name": "support.type.swift", + "match": "\\b(?:BitwiseShift|Assignment|RangeFormation|Casting|Addition|NilCoalescing|Comparison|LogicalConjunction|LogicalDisjunction|Default|Ternary|Multiplication|FunctionArrow)Precedence\\b" + } + ] + }, "expressions": { + "comment": "trailing closures need to be parsed before other member references", + "patterns": [ + { + "include": "#expressions-without-trailing-closures-or-member-references" + }, + { + "include": "#expressions-trailing-closure" + }, + { + "include": "#member-reference" + } + ] + }, + "expressions-trailing-closure": { + "patterns": [ + { + "comment": "foo { body } -- a call with a trailing closure and no argument clause", + "name": "meta.function-call.trailing-closure-only.swift", + "match": "(#?(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))(?=\\s*\\{)", + "captures": { + "1": { + "name": "support.function.any-method.swift" + }, + "2": { + "name": "punctuation.definition.identifier.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + } + } + }, + { + "comment": "foo: { body } -- labeled-trailing-closure (SE-0279)", + "match": "((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*(:)(?=\\s*\\{)", + "captures": { + "1": { + "name": "support.function.any-method.trailing-closure-label.swift" + }, + "2": { + "name": "punctuation.definition.identifier.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.separator.argument-label.swift" + } + } + } + ] + }, + "expressions-without-trailing-closures": { + "patterns": [ + { + "include": "#expressions-without-trailing-closures-or-member-references" + }, + { + "include": "#member-references" + } + ] + }, + "expressions-without-trailing-closures-or-member-references": { "patterns": [ { "include": "#comments" @@ -2299,7 +2518,7 @@ "include": "#attributes" }, { - "include": "#closure-parameter" + "include": "#expressions-without-trailing-closures-or-member-references-closure-parameter" }, { "include": "#literals" @@ -2320,294 +2539,287 @@ "include": "#builtin-properties" }, { - "include": "#compound-name" + "include": "#expressions-without-trailing-closures-or-member-references-compound-name" + }, + { + "include": "#conditionals" }, { "include": "#keywords" }, { - "include": "#function-call-expression" + "include": "#expressions-without-trailing-closures-or-member-references-availability-condition" }, { - "include": "#subscript-expression" + "include": "#expressions-without-trailing-closures-or-member-references-function-or-macro-call-expression" }, { - "include": "#parenthesized-expression" + "include": "#expressions-without-trailing-closures-or-member-references-macro-expansion" }, { - "include": "#member-reference" + "include": "#expressions-without-trailing-closures-or-member-references-subscript-expression" }, { - "include": "#availability-condition" + "include": "#expressions-without-trailing-closures-or-member-references-parenthesized-expression" }, { - "match": "\\b_\\b", - "name": "support.variable.discard-value.swift" + "name": "support.variable.discard-value.swift", + "match": "\\b_\\b" } - ], - "repository": { - "availability-condition": { - "begin": "\\B(#(?:un)?available)(\\()", - "beginCaptures": { - "1": { - "name": "support.function.availability-condition.swift" - }, - "2": { - "name": "punctuation.definition.arguments.begin.swift" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.swift" - } - }, - "patterns": [ - { - "captures": { - "1": { - "name": "keyword.other.platform.os.swift" - }, - "2": { - "name": "constant.numeric.swift" - } - }, - "match": "\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))" - }, - { - "captures": { - "1": { - "name": "keyword.other.platform.all.swift" - }, - "2": { - "name": "invalid.illegal.character-not-allowed-here.swift" - } - }, - "match": "(\\*)\\s*(.*?)(?=[,)])" - }, - { - "match": "[^\\s,)]+", - "name": "invalid.illegal.character-not-allowed-here.swift" - } - ] + ] + }, + "expressions-without-trailing-closures-or-member-references-availability-condition": { + "begin": "\\B(#(?:un)?available)(\\()", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "support.function.availability-condition.swift" }, - "closure-parameter": { - "match": "\\$[0-9]+", - "name": "variable.language.closure-parameter.swift" - }, - "compound-name": { + "2": { + "name": "punctuation.definition.arguments.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.swift" + } + }, + "patterns": [ + { + "match": "\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))", "captures": { "1": { - "name": "entity.name.function.compound-name.swift" + "name": "keyword.other.platform.os.swift" }, "2": { - "name": "punctuation.definition.entity.swift" - }, - "3": { - "name": "punctuation.definition.entity.swift" - }, - "4": { - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.definition.entity.swift" - }, - "2": { - "name": "punctuation.definition.entity.swift" - } - }, - "match": "(?`?)(?!_:)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k):", - "name": "entity.name.function.compound-name.swift" - } - ] + "name": "constant.numeric.swift" } - }, - "comment": "a reference to a function with disambiguating argument labels, such as foo(_:), foo(bar:), etc.", - "match": "(?x)\n\t\t\t\t\t\t((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)) \t\t# function name\n\t\t\t\t\t\t\\(\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)) \t# argument label\n\t\t\t\t\t\t\t\t\t:\t\t\t\t\t\t\t\t\t\t\t\t# colon\n\t\t\t\t\t\t\t\t)+\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\\)\n\t\t\t\t\t" + } }, - "expression-element-list": { - "patterns": [ - { - "include": "#comments" + { + "match": "(\\*)\\s*(.*?)(?=[,)])", + "captures": { + "1": { + "name": "keyword.other.platform.all.swift" }, - { - "begin": "((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*(:)", - "beginCaptures": { - "1": { - "name": "support.function.any-method.swift" - }, - "2": { - "name": "punctuation.definition.identifier.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.separator.argument-label.swift" - } - }, - "comment": "an element with a label", - "end": "(?=[,)\\]])", - "patterns": [ - { - "include": "#expressions" - } - ] - }, - { - "begin": "(?![,)\\]])(?=\\S)", - "comment": "an element without a label (i.e. anything else)", - "end": "(?=[,)\\]])", - "patterns": [ - { - "include": "#expressions" - } - ] + "2": { + "name": "invalid.illegal.character-not-allowed-here.swift" } - ] + } }, - "function-call-expression": { - "patterns": [ - { - "begin": "((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*(\\()", - "beginCaptures": { - "1": { - "name": "support.function.any-method.swift" - }, - "2": { - "name": "punctuation.definition.identifier.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" - }, - "4": { - "name": "punctuation.definition.arguments.begin.swift" - } - }, - "comment": "foo(args) -- a call whose callee is a highlightable name", - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.swift" - } - }, - "name": "meta.function-call.swift", - "patterns": [ - { - "include": "#expression-element-list" - } - ] - }, - { - "begin": "(?<=[`\\])}>\\p{L}_\\p{N}\\p{M}])\\s*(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.swift" - } - }, - "comment": "[Int](args) -- a call whose callee is a more complicated expression", - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.swift" - } - }, - "name": "meta.function-call.swift", - "patterns": [ - { - "include": "#expression-element-list" - } - ] - } - ] + { + "name": "invalid.illegal.character-not-allowed-here.swift", + "match": "[^\\s,)]+" + } + ] + }, + "expressions-without-trailing-closures-or-member-references-closure-parameter": { + "name": "variable.language.closure-parameter.swift", + "match": "\\$[0-9]+" + }, + "expressions-without-trailing-closures-or-member-references-compound-name": { + "comment": "a reference to a function with disambiguating argument labels, such as foo(_:), foo(bar:), etc.", + "match": "(?x)\n((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)) # function name\n\\(\n (\n (\n ((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k)) # argument label\n : # colon\n )+\n )\n\\)", + "captures": { + "1": { + "name": "entity.name.function.compound-name.swift" + }, + "2": { + "name": "punctuation.definition.entity.swift" + }, + "3": { + "name": "punctuation.definition.entity.swift" }, - "member-reference": { + "4": { "patterns": [ { + "name": "entity.name.function.compound-name.swift", + "match": "(?`?)(?!_:)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k):", "captures": { "1": { - "name": "variable.other.swift" + "name": "punctuation.definition.entity.swift" }, "2": { - "name": "punctuation.definition.identifier.swift" - }, - "3": { - "name": "punctuation.definition.identifier.swift" + "name": "punctuation.definition.entity.swift" } - }, - "match": "(?<=\\.)((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))" - } - ] - }, - "parenthesized-expression": { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.section.tuple.begin.swift" - } - }, - "comment": "correctly matching closure expressions is too hard (depends on trailing \"in\") so we just tack on some basics to the end of parenthesized-expression", - "end": "(\\))\\s*((?:\\b(?:async|throws|rethrows)\\s)*)", - "endCaptures": { - "1": { - "name": "punctuation.section.tuple.end.swift" - }, - "2": { - "patterns": [ - { - "match": "\\brethrows\\b", - "name": "invalid.illegal.rethrows-only-allowed-on-function-declarations.swift" - }, - { - "include": "#async-throws" - } - ] - } - }, - "patterns": [ - { - "include": "#expression-element-list" - } - ] - }, - "subscript-expression": { - "begin": "(?<=[`\\p{L}_\\p{N}\\p{M}])\\s*(\\[)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.swift" - } - }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.swift" - } - }, - "name": "meta.subscript-expression.swift", - "patterns": [ - { - "include": "#expression-element-list" + } } ] } } }, + "expressions-without-trailing-closures-or-member-references-expression-element-list": { + "patterns": [ + { + "include": "#comments" + }, + { + "comment": "an element with a label", + "begin": "((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*(:)", + "end": "(?=[,)\\]])", + "beginCaptures": { + "1": { + "name": "support.function.any-method.swift" + }, + "2": { + "name": "punctuation.definition.identifier.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.separator.argument-label.swift" + } + }, + "patterns": [ + { + "include": "#expressions" + } + ] + }, + { + "comment": "an element without a label (i.e. anything else)", + "begin": "(?![,)\\]])(?=\\S)", + "end": "(?=[,)\\]])", + "patterns": [ + { + "include": "#expressions" + } + ] + } + ] + }, + "expressions-without-trailing-closures-or-member-references-function-or-macro-call-expression": { + "patterns": [ + { + "comment": "foo(args) -- a call whose callee is a highlightable name", + "name": "meta.function-call.swift", + "begin": "(#?(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))\\s*(\\()", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "support.function.any-method.swift" + }, + "2": { + "name": "punctuation.definition.identifier.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + }, + "4": { + "name": "punctuation.definition.arguments.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.swift" + } + }, + "patterns": [ + { + "include": "#expressions-without-trailing-closures-or-member-references-expression-element-list" + } + ] + }, + { + "comment": "[Int](args) -- a call whose callee is a more complicated expression", + "name": "meta.function-call.swift", + "begin": "(?<=[`\\])}>\\p{L}_\\p{N}\\p{M}])\\s*(\\()", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.arguments.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.swift" + } + }, + "patterns": [ + { + "include": "#expressions-without-trailing-closures-or-member-references-expression-element-list" + } + ] + } + ] + }, + "expressions-without-trailing-closures-or-member-references-macro-expansion": { + "name": "support.function.any-method.swift", + "match": "(#(?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))" + }, + "expressions-without-trailing-closures-or-member-references-parenthesized-expression": { + "comment": "correctly matching closure expressions is too hard (depends on trailing \"in\") so we just tack on some basics to the end of parenthesized-expression", + "begin": "\\(", + "end": "(\\))\\s*((?:\\b(?:async|throws|rethrows)\\s)*)", + "beginCaptures": { + "0": { + "name": "punctuation.section.tuple.begin.swift" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.section.tuple.end.swift" + }, + "2": { + "patterns": [ + { + "name": "invalid.illegal.rethrows-only-allowed-on-function-declarations.swift", + "match": "\\brethrows\\b" + }, + { + "include": "#async-throws" + } + ] + } + }, + "patterns": [ + { + "include": "#expressions-without-trailing-closures-or-member-references-expression-element-list" + } + ] + }, + "expressions-without-trailing-closures-or-member-references-subscript-expression": { + "name": "meta.subscript-expression.swift", + "begin": "(?<=[`\\p{L}_\\p{N}\\p{M}])\\s*(\\[)", + "end": "\\]", + "beginCaptures": { + "1": { + "name": "punctuation.definition.arguments.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.swift" + } + }, + "patterns": [ + { + "include": "#expressions-without-trailing-closures-or-member-references-expression-element-list" + } + ] + }, "keywords": { "patterns": [ { - "match": "(?\n (?> # no backtracking, avoids issues with negative lookbehind at end\n (?:\n \\\\Q\n (?:(?!\\\\E)(?!/\\2).)*+\n (?:\\\\E\n # A quoted sequence may not have a closing E, in which case it extends to the end of the regex\n | (?(3)|(?\\{)?+(?\\{)?+(?\\{)?+(?\\{)?+(?\\{)?+\n .+?\n \\}(?()\\})(?()\\})(?()\\})(?()\\})(?()\\})\n (?:\\[(?!\\d)\\w+\\])?\n [X<>]?\n \\)\n | (?\\[ (?:\\\\. | [^\\[\\]] | \\g)+ \\])\n | \\(\\g?+\\)\n | (?:(?!/\\2)[^()\\[\\\\])+ # any character (until end)\n )+\n )\n)?+\n# may end with a space only if it is an extended literal or contains only a single escaped space\n(?(3)|(?(5)(?'\n \"\\k'\" NamedOrNumberRef \"'\"\n '\\g<' NamedOrNumberRef '>'\n \"\\g'\" NamedOrNumberRef \"'\"", + "match": "(?x)(\\\\[gk](<)|\\\\[gk]') (?: ((?!\\d)\\w+) (?:([+-])(\\d+))? | ([+-]?\\d+) (?:([+-])(\\d+))? ) ((?(2)>|'))", + "captures": { + "1": { + "name": "constant.character.escape.backslash.regexp" + }, + "3": { + "name": "variable.other.group-name.regexp" + }, + "4": { + "name": "keyword.operator.recursion-level.regexp" + }, + "5": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "6": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "7": { + "name": "keyword.operator.recursion-level.regexp" + }, + "8": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "9": { + "name": "constant.character.escape.backslash.regexp" + } + } + }, + { + "comment": "'\\k{' NamedRef '}'", + "match": "(?x)(\\\\k\\{) ((?!\\d)\\w+) (?:([+-])(\\d+))? (\\})", + "captures": { + "1": { + "name": "constant.character.escape.backslash.regexp" + }, + "2": { + "name": "variable.other.group-name.regexp" + }, + "3": { + "name": "keyword.operator.recursion-level.regexp" + }, + "4": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "5": { + "name": "constant.character.escape.backslash.regexp" + } + } + }, + { + "name": "keyword.other.back-reference.regexp", + "match": "\\\\[1-9][0-9]+" + }, + { + "comment": "'(?P=' NamedRef ')'", + "match": "(?x)(\\(\\?(?:P[=>]|&)) ((?!\\d)\\w+) (?:([+-])(\\d+))? (\\))", + "captures": { + "1": { + "name": "keyword.other.back-reference.regexp" + }, + "2": { + "name": "variable.other.group-name.regexp" + }, + "3": { + "name": "keyword.operator.recursion-level.regexp" + }, + "4": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "5": { + "name": "keyword.other.back-reference.regexp" + } + } + }, + { + "name": "keyword.other.back-reference.regexp", + "match": "\\(\\?R\\)" + }, + { + "comment": "'(?' NumberRef ')'", + "match": "(?x)(\\(\\?) ([+-]?\\d+) (?:([+-])(\\d+))? (\\))", + "captures": { + "1": { + "name": "keyword.other.back-reference.regexp" + }, + "2": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "3": { + "name": "keyword.operator.recursion-level.regexp" + }, + "4": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "5": { + "name": "keyword.other.back-reference.regexp" + } + } + } + ] + }, + "literals-regular-expression-literal-backtracking-directive-or-global-matching-option": { + "match": "(?x)\n(\\(\\*)\n(?:\n (ACCEPT|FAIL|F|MARK(?=:)|(?=:)|COMMIT|PRUNE|SKIP|THEN)\n (?:(:)([^)]+))?\n | (?:(LIMIT_(?:DEPTH|HEAP|MATCH))(=)(\\d+))\n | (\n CRLF | CR | ANYCRLF | ANY | LF | NUL\n | BSR_ANYCRLF | BSR_UNICODE\n | NOTEMPTY_ATSTART | NOTEMPTY\n | NO_AUTO_POSSESS | NO_DOTSTAR_ANCHOR\n | NO_JIT | NO_START_OPT | UTF | UCP\n )\n)\n(\\))", + "captures": { + "1": { + "name": "keyword.control.directive.regexp" + }, + "2": { + "name": "keyword.control.directive.regexp" + }, + "3": { + "name": "keyword.control.directive.regexp" + }, + "4": { + "name": "variable.language.tag.regexp" + }, + "5": { + "name": "keyword.control.directive.regexp" + }, + "6": { + "name": "keyword.operator.assignment.regexp" + }, + "7": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "8": { + "name": "keyword.control.directive.regexp" + }, + "9": { + "name": "keyword.control.directive.regexp" + } } }, + "literals-regular-expression-literal-callout": { + "name": "meta.callout.regexp", + "match": "(?x)\n# PCRECallout\n(\\()(?\\?C)\n (?:\n (?\\d+)\n | `(?(?:[^`]|``)*)`\n | '(?(?:[^']|'')*)'\n | \"(?(?:[^\"]|\"\")*)\"\n | \\^(?(?:[^\\^]|\\^\\^)*)\\^\n | %(?(?:[^%]|%%)*)%\n | \\#(?(?:[^#]|\\#\\#)*)\\#\n | \\$(?(?:[^$]|\\$\\$)*)\\$\n | \\{(?(?:[^}]|\\}\\})*)\\}\n )?\n(\\))\n# NamedCallout\n| (\\()(?\\*)\n (?(?!\\d)\\w+)\n (?:\\[(?(?!\\d)\\w+)\\])?\n (?:\\{ [^,}]+ (?:,[^,}]+)* \\})?\n (\\))\n# InterpolatedCallout\n| (\\()(?\\?)\n # we only support a fixed maximum number of braces because otherwise we can't balance the number of open and close braces\n (\\{(?\\{)?+(?\\{)?+(?\\{)?+(?\\{)?+(?\\{)?+) .+? \\}(?()\\})(?()\\})(?()\\})(?()\\})(?()\\})\n (?:\\[(?(?!\\d)\\w+)\\])?\n (?[X<>]?)\n (\\))", + "captures": { + "1": { + "name": "punctuation.definition.group.regexp" + }, + "2": { + "name": "keyword.control.callout.regexp" + }, + "3": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "4": { + "name": "entity.name.function.callout.regexp" + }, + "5": { + "name": "entity.name.function.callout.regexp" + }, + "6": { + "name": "entity.name.function.callout.regexp" + }, + "7": { + "name": "entity.name.function.callout.regexp" + }, + "8": { + "name": "entity.name.function.callout.regexp" + }, + "9": { + "name": "entity.name.function.callout.regexp" + }, + "10": { + "name": "entity.name.function.callout.regexp" + }, + "11": { + "name": "entity.name.function.callout.regexp" + }, + "12": { + "name": "punctuation.definition.group.regexp" + }, + "13": { + "name": "punctuation.definition.group.regexp" + }, + "14": { + "name": "keyword.control.callout.regexp" + }, + "15": { + "name": "entity.name.function.callout.regexp" + }, + "16": { + "name": "variable.language.tag-name.regexp" + }, + "17": { + "name": "punctuation.definition.group.regexp" + }, + "18": { + "name": "punctuation.definition.group.regexp" + }, + "19": { + "name": "keyword.control.callout.regexp" + }, + "26": { + "name": "variable.language.tag-name.regexp" + }, + "27": { + "name": "keyword.control.callout.regexp" + }, + "28": { + "name": "punctuation.definition.group.regexp" + } + } + }, + "literals-regular-expression-literal-character-properties": { + "name": "constant.other.character-class.set.regexp", + "match": "(?x)\n\\\\[pP]\\{ ([\\s\\w-]+(?:=[\\s\\w-]+)?) \\}\n| (\\[:) ([\\s\\w-]+(?:=[\\s\\w-]+)?) (:\\])", + "captures": { + "1": { + "name": "support.variable.character-property.regexp" + }, + "2": { + "name": "punctuation.definition.character-class.regexp" + }, + "3": { + "name": "support.variable.character-property.regexp" + }, + "4": { + "name": "punctuation.definition.character-class.regexp" + } + } + }, + "literals-regular-expression-literal-custom-char-class": { + "patterns": [ + { + "name": "constant.other.character-class.set.regexp", + "begin": "(\\[)(\\^)?", + "end": "\\]", + "beginCaptures": { + "1": { + "name": "punctuation.definition.character-class.regexp" + }, + "2": { + "name": "keyword.operator.negation.regexp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.character-class.regexp" + } + }, + "patterns": [ + { + "include": "#literals-regular-expression-literal-custom-char-class-members" + } + ] + } + ] + }, + "literals-regular-expression-literal-custom-char-class-members": { + "comment": "TODO: should also include atoms?", + "patterns": [ + { + "comment": "\\b inside a character class represents a backspace", + "name": "constant.character.escape.backslash.regexp", + "match": "\\\\b" + }, + { + "include": "#literals-regular-expression-literal-custom-char-class" + }, + { + "include": "#literals-regular-expression-literal-quote" + }, + { + "include": "#literals-regular-expression-literal-set-operators" + }, + { + "include": "#literals-regular-expression-literal-unicode-scalars" + }, + { + "include": "#literals-regular-expression-literal-character-properties" + } + ] + }, + "literals-regular-expression-literal-group-option-toggle": { + "comment": "A matching option sequence may be part of an \"isolated group\" which has an implicit scope that wraps the remaining elements of the current group", + "name": "keyword.other.option-toggle.regexp", + "match": "(?x)\n\\(\\?\n(?:\n \\^(?:[iJmnsUxwDPSW]|xx|y\\{[gw]\\})*\n | (?:[iJmnsUxwDPSW]|xx|y\\{[gw]\\})+\n | (?:[iJmnsUxwDPSW]|xx|y\\{[gw]\\})* - (?:[iJmnsUxwDPSW]|xx|y\\{[gw]\\})*\n)\n\\)" + }, + "literals-regular-expression-literal-group-or-conditional": { + "patterns": [ + { + "name": "meta.group.absent.regexp", + "begin": "(\\()(\\?~)", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + }, + "2": { + "name": "keyword.control.conditional.absent.regexp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + } + }, + "patterns": [ + { + "include": "#literals-regular-expression-literal-regex-guts" + } + ] + }, + { + "name": "meta.group.conditional.regexp", + "begin": "(?x)\n# KnownConditionalStart\n(\\() (?\\?\\()\n (?:\n (? (?[+-]?\\d+)(?:(?[+-])(?\\d+))? )\n | (?R) \\g?\n | (?R&) (? (?(?!\\d)\\w+) (?:(?[+-])(?\\d+))? )\n | (?<) (?:\\g|\\g) (?>)\n | (?') (?:\\g|\\g) (?')\n | (?DEFINE)\n | (?VERSION)(?>?=)(?\\d+\\.\\d+)\n )\n(?\\))\n| (\\()(?\\?)(?=\\()", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + }, + "2": { + "name": "keyword.control.conditional.regexp" + }, + "4": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "5": { + "name": "keyword.operator.recursion-level.regexp" + }, + "6": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "7": { + "name": "keyword.control.conditional.regexp" + }, + "8": { + "name": "keyword.control.conditional.regexp" + }, + "10": { + "name": "variable.other.group-name.regexp" + }, + "11": { + "name": "keyword.operator.recursion-level.regexp" + }, + "12": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "13": { + "name": "keyword.control.conditional.regexp" + }, + "14": { + "name": "keyword.control.conditional.regexp" + }, + "15": { + "name": "keyword.control.conditional.regexp" + }, + "16": { + "name": "keyword.control.conditional.regexp" + }, + "17": { + "name": "keyword.control.conditional.regexp" + }, + "18": { + "name": "keyword.control.conditional.regexp" + }, + "19": { + "name": "keyword.operator.comparison.regexp" + }, + "20": { + "name": "constant.numeric.integer.decimal.regexp" + }, + "21": { + "name": "keyword.control.conditional.regexp" + }, + "22": { + "name": "punctuation.definition.group.regexp" + }, + "23": { + "name": "keyword.control.conditional.regexp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + } + }, + "patterns": [ + { + "include": "#literals-regular-expression-literal-regex-guts" + } + ] + }, + { + "name": "meta.group.regexp", + "begin": "(?x)\n(\\()\n(\n # BasicGroupKind\n (\\?)\n (?:\n ([:|>=!*] | <[=!*])\n # named groups\n | P?< (?:((?!\\d)\\w+) (-))? ((?!\\d)\\w+) >\n | ' (?:((?!\\d)\\w+) (-))? ((?!\\d)\\w+) '\n # matching options\n | (?:\n \\^(?:[iJmnsUxwDPSW]|xx|y\\{[gw]\\})*\n | (?:[iJmnsUxwDPSW]|xx|y\\{[gw]\\})+\n | (?:[iJmnsUxwDPSW]|xx|y\\{[gw]\\})* - (?:[iJmnsUxwDPSW]|xx|y\\{[gw]\\})*\n ): # case without : is handled by group-option-toggle\n )\n # PCRE2GroupKind\n | \\*(\n atomic\n |pla|positive_lookahead\n |nla|negative_lookahead\n |plb|positive_lookbehind\n |nlb|negative_lookbehind\n |napla|non_atomic_positive_lookahead\n |naplb|non_atomic_positive_lookbehind\n |sr|script_run\n |asr|atomic_script_run\n ):\n)?+", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + }, + "2": { + "name": "keyword.other.group-options.regexp" + }, + "3": { + "name": "punctuation.definition.group.regexp" + }, + "4": { + "name": "punctuation.definition.group.regexp" + }, + "5": { + "name": "variable.other.group-name.regexp" + }, + "6": { + "name": "keyword.operator.balancing-group.regexp" + }, + "7": { + "name": "variable.other.group-name.regexp" + }, + "8": { + "name": "variable.other.group-name.regexp" + }, + "9": { + "name": "keyword.operator.balancing-group.regexp" + }, + "10": { + "name": "variable.other.group-name.regexp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + } + }, + "patterns": [ + { + "include": "#literals-regular-expression-literal-regex-guts" + } + ] + } + ] + }, + "literals-regular-expression-literal-line-comment": { + "name": "comment.line.regexp", + "match": "(\\#).*$", + "captures": { + "1": { + "name": "punctuation.definition.comment.regexp" + } + } + }, + "literals-regular-expression-literal-quote": { + "name": "string.quoted.other.regexp.swift", + "begin": "\\\\Q", + "end": "\\\\E|(\\n)", + "beginCaptures": { + "0": { + "name": "constant.character.escape.backslash.regexp" + } + }, + "endCaptures": { + "0": { + "name": "constant.character.escape.backslash.regexp" + }, + "1": { + "name": "invalid.illegal.returns-not-allowed.regexp" + } + } + }, + "literals-regular-expression-literal-regex-guts": { + "patterns": [ + { + "include": "#literals-regular-expression-literal-quote" + }, + { + "name": "comment.block.regexp", + "begin": "\\(\\?\\#", + "end": "\\)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.regexp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.regexp" + } + } + }, + { + "name": "meta.embedded.expression.regexp", + "begin": "<\\{", + "end": "\\}>", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.regexp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.regexp" + } + } + }, + { + "include": "#literals-regular-expression-literal-unicode-scalars" + }, + { + "include": "#literals-regular-expression-literal-character-properties" + }, + { + "name": "keyword.control.anchor.regexp", + "match": "[$^]|\\\\[AbBGyYzZ]|\\\\K" + }, + { + "include": "#literals-regular-expression-literal-backtracking-directive-or-global-matching-option" + }, + { + "include": "#literals-regular-expression-literal-callout" + }, + { + "include": "#literals-regular-expression-literal-backreference-or-subpattern" + }, + { + "name": "constant.character.character-class.regexp", + "match": "\\.|\\\\[CdDhHNORsSvVwWX]" + }, + { + "name": "constant.character.entity.control-character.regexp", + "match": "\\\\c." + }, + { + "name": "constant.character.escape.backslash.regexp", + "match": "\\\\[^c]" + }, + { + "name": "keyword.operator.or.regexp", + "match": "\\|" + }, + { + "name": "keyword.operator.quantifier.regexp", + "match": "[*+?]" + }, + { + "name": "keyword.operator.quantifier.regexp", + "match": "\\{\\s*\\d+\\s*(?:,\\s*\\d*\\s*)?\\}|\\{\\s*,\\s*\\d+\\s*\\}" + }, + { + "include": "#literals-regular-expression-literal-custom-char-class" + }, + { + "include": "#literals-regular-expression-literal-group-option-toggle" + }, + { + "include": "#literals-regular-expression-literal-group-or-conditional" + } + ] + }, + "literals-regular-expression-literal-set-operators": { + "patterns": [ + { + "name": "keyword.operator.intersection.regexp.swift", + "match": "&&" + }, + { + "name": "keyword.operator.subtraction.regexp.swift", + "match": "--" + }, + { + "name": "keyword.operator.symmetric-difference.regexp.swift", + "match": "\\~\\~" + } + ] + }, + "literals-regular-expression-literal-unicode-scalars": { + "name": "constant.character.numeric.regexp", + "match": "(?x)\n\\\\u\\{\\s*(?:[0-9a-fA-F]+\\s*)+\\}\n| \\\\u[0-9a-fA-F]{4}\n| \\\\x\\{[0-9a-fA-F]+\\}\n| \\\\x[0-9a-fA-F]{0,2}\n| \\\\U[0-9a-fA-F]{8}\n| \\\\o\\{[0-7]+\\}\n| \\\\0[0-7]{0,3}\n| \\\\N\\{(?:U\\+[0-9a-fA-F]{1,8} | [\\s\\w-]+)\\}" + }, + "literals-string": { + "patterns": [ + { + "comment": "SE-0168: Multi-Line String Literals", + "name": "string.quoted.double.block.swift", + "begin": "\"\"\"", + "end": "\"\"\"(#*)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.swift" + }, + "1": { + "name": "invalid.illegal.extra-closing-delimiter.swift" + } + }, + "patterns": [ + { + "name": "invalid.illegal.content-after-opening-delimiter.swift", + "match": "\\G.+(?=\"\"\")|\\G.+" + }, + { + "name": "constant.character.escape.newline.swift", + "match": "\\\\\\s*\\n" + }, + { + "include": "#literals-string-string-guts" + }, + { + "comment": "Allow \\(\"\"\"...\"\"\") to appear inside a block string", + "name": "invalid.illegal.content-before-closing-delimiter.swift", + "match": "\\S((?!\\\\\\().)*(?=\"\"\")" + } + ] + }, + { + "name": "string.quoted.double.block.raw.swift", + "begin": "#\"\"\"", + "end": "\"\"\"#(#*)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.swift" + }, + "1": { + "name": "invalid.illegal.extra-closing-delimiter.swift" + } + }, + "patterns": [ + { + "name": "invalid.illegal.content-after-opening-delimiter.swift", + "match": "\\G.+(?=\"\"\")|\\G.+" + }, + { + "name": "constant.character.escape.newline.swift", + "match": "\\\\#\\s*\\n" + }, + { + "include": "#literals-string-raw-string-guts" + }, + { + "comment": "Allow \\(\"\"\"...\"\"\") to appear inside a block string", + "name": "invalid.illegal.content-before-closing-delimiter.swift", + "match": "\\S((?!\\\\#\\().)*(?=\"\"\")" + } + ] + }, + { + "name": "string.quoted.double.block.raw.swift", + "begin": "(##+)\"\"\"", + "end": "\"\"\"\\1(#*)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.swift" + }, + "1": { + "name": "invalid.illegal.extra-closing-delimiter.swift" + } + }, + "patterns": [ + { + "name": "invalid.illegal.content-after-opening-delimiter.swift", + "match": "\\G.+(?=\"\"\")|\\G.+" + } + ] + }, + { + "name": "string.quoted.double.single-line.swift", + "begin": "\"", + "end": "\"(#*)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.swift" + }, + "1": { + "name": "invalid.illegal.extra-closing-delimiter.swift" + } + }, + "patterns": [ + { + "name": "invalid.illegal.returns-not-allowed.swift", + "match": "\\r|\\n" + }, + { + "include": "#literals-string-string-guts" + } + ] + }, + { + "comment": "SE-0168: raw string literals (more than one #, grammar limitations prevent us from supporting escapes)", + "name": "string.quoted.double.single-line.raw.swift", + "begin": "(##+)\"", + "end": "\"\\1(#*)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.raw.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.raw.swift" + }, + "1": { + "name": "invalid.illegal.extra-closing-delimiter.swift" + } + }, + "patterns": [ + { + "name": "invalid.illegal.returns-not-allowed.swift", + "match": "\\r|\\n" + } + ] + }, + { + "comment": "SE-0168: raw string literals (one #, escapes supported)", + "name": "string.quoted.double.single-line.raw.swift", + "begin": "#\"", + "end": "\"#(#*)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.raw.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.raw.swift" + }, + "1": { + "name": "invalid.illegal.extra-closing-delimiter.swift" + } + }, + "patterns": [ + { + "name": "invalid.illegal.returns-not-allowed.swift", + "match": "\\r|\\n" + }, + { + "include": "#literals-string-raw-string-guts" + } + ] + } + ] + }, + "literals-string-raw-string-guts": { + "comment": "the same as #string-guts but with # in escapes", + "patterns": [ + { + "name": "constant.character.escape.swift", + "match": "\\\\#[0\\\\tnr\"']" + }, + { + "name": "constant.character.escape.unicode.swift", + "match": "\\\\#u\\{[0-9a-fA-F]{1,8}\\}" + }, + { + "contentName": "source.swift", + "name": "meta.embedded.line.swift", + "begin": "\\\\#\\(", + "end": "(\\))", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.swift" + }, + "1": { + "name": "source.swift" + } + }, + "patterns": [ + { + "include": "$self" + }, + { + "comment": "Nested parens", + "begin": "\\(", + "end": "\\)" + } + ] + }, + { + "name": "invalid.illegal.escape-not-recognized", + "match": "\\\\#." + } + ] + }, + "literals-string-string-guts": { + "patterns": [ + { + "name": "constant.character.escape.swift", + "match": "\\\\[0\\\\tnr\"']" + }, + { + "name": "constant.character.escape.unicode.swift", + "match": "\\\\u\\{[0-9a-fA-F]{1,8}\\}" + }, + { + "contentName": "source.swift", + "name": "meta.embedded.line.swift", + "begin": "\\\\\\(", + "end": "(\\))", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.swift" + }, + "1": { + "name": "source.swift" + } + }, + "patterns": [ + { + "include": "$self" + }, + { + "comment": "Nested parens", + "begin": "\\(", + "end": "\\)" + } + ] + }, + { + "name": "invalid.illegal.escape-not-recognized", + "match": "\\\\." + } + ] + }, + "member-reference": { + "patterns": [ + { + "match": "(?<=\\.)((?`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k))", + "captures": { + "1": { + "name": "variable.other.swift" + }, + "2": { + "name": "punctuation.definition.identifier.swift" + }, + "3": { + "name": "punctuation.definition.identifier.swift" + } + } + } + ] + }, "operators": { "patterns": [ { "comment": "Type casting", - "match": "\\b(is\\b|as([!?]\\B|\\b))", - "name": "keyword.operator.type-casting.swift" + "name": "keyword.operator.type-casting.swift", + "match": "\\b(is\\b|as([!?]\\B|\\b))" }, { - "begin": "(?x)\n\t\t\t\t\t\t(?=\n\t\t\t\t\t\t\t(?\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t | \\.\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\\g\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t | \\.\n\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t", "comment": "This rule helps us speed up the matching.", + "begin": "(?x)\n(?=\n (? # operator-head\n [/=\\-+!*%<>&|^~?]\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n )\n | \\.\n (\n \\g # operator-head\n | \\.\n | [\\x{0300}-\\x{036F}] # operator-character\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n)", "end": "(?!\\G)", "patterns": [ { - "captures": { - "0": { - "patterns": [ - { - "match": "\\G(\\+\\+|\\-\\-)$", - "name": "keyword.operator.increment-or-decrement.swift" - }, - { - "match": "\\G(\\+|\\-)$", - "name": "keyword.operator.arithmetic.unary.swift" - }, - { - "match": "\\G!$", - "name": "keyword.operator.logical.not.swift" - }, - { - "match": "\\G~$", - "name": "keyword.operator.bitwise.not.swift" - }, - { - "match": ".+", - "name": "keyword.operator.custom.prefix.swift" - } - ] - } - }, "comment": "Prefix unary operator", - "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?<=^|[\\s(\\[{,;:])\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?![\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t" - }, - { + "match": "(?x)\n\\G # Matching from the beginning ensures\n # that we start with operator-head\n(?<=^|[\\s(\\[{,;:])\n(\n (?!(//|/\\*|\\*/))\n (\n [/=\\-+!*%<>&|^~?] # operator-head\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n \n | [\\x{0300}-\\x{036F}] # operator-character\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n)++\n(?![\\s)\\]},;:]|\\z)", "captures": { "0": { "patterns": [ { - "match": "\\G(\\+\\+|\\-\\-)$", - "name": "keyword.operator.increment-or-decrement.swift" + "name": "keyword.operator.increment-or-decrement.swift", + "match": "\\G(\\+\\+|\\-\\-)$" }, { - "match": "\\G!$", - "name": "keyword.operator.increment-or-decrement.swift" + "name": "keyword.operator.arithmetic.unary.swift", + "match": "\\G(\\+|\\-)$" }, { - "match": ".+", - "name": "keyword.operator.custom.postfix.swift" + "name": "keyword.operator.logical.not.swift", + "match": "\\G!$" + }, + { + "name": "keyword.operator.bitwise.not.swift", + "match": "\\G~$" + }, + { + "name": "keyword.operator.custom.prefix.swift", + "match": ".+" } ] } - }, + } + }, + { "comment": "Postfix unary operator", - "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?=[\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t" - }, - { + "match": "(?x)\n\\G # Matching from the beginning ensures\n # that we start with operator-head\n(?&|^~?] # operator-head\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n \n | [\\x{0300}-\\x{036F}] # operator-character\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n)++\n(?=[\\s)\\]},;:]|\\z)", "captures": { "0": { "patterns": [ { - "match": "\\G=$", - "name": "keyword.operator.assignment.swift" + "name": "keyword.operator.increment-or-decrement.swift", + "match": "\\G(\\+\\+|\\-\\-)$" }, { - "match": "\\G(\\+|\\-|\\*|/|%|<<|>>|&|\\^|\\||&&|\\|\\|)=$", - "name": "keyword.operator.assignment.compound.swift" + "name": "keyword.operator.increment-or-decrement.swift", + "match": "\\G!$" }, { - "match": "\\G(\\+|\\-|\\*|/)$", - "name": "keyword.operator.arithmetic.swift" - }, - { - "match": "\\G&(\\+|\\-|\\*)$", - "name": "keyword.operator.arithmetic.overflow.swift" - }, - { - "match": "\\G%$", - "name": "keyword.operator.arithmetic.remainder.swift" - }, - { - "match": "\\G(==|!=|>|<|>=|<=|~=)$", - "name": "keyword.operator.comparison.swift" - }, - { - "match": "\\G\\?\\?$", - "name": "keyword.operator.coalescing.swift" - }, - { - "match": "\\G(&&|\\|\\|)$", - "name": "keyword.operator.logical.swift" - }, - { - "match": "\\G(&|\\||\\^|<<|>>)$", - "name": "keyword.operator.bitwise.swift" - }, - { - "match": "\\G(===|!==)$", - "name": "keyword.operator.bitwise.swift" - }, - { - "match": "\\G\\?$", - "name": "keyword.operator.ternary.swift" - }, - { - "match": ".+", - "name": "keyword.operator.custom.infix.swift" + "name": "keyword.operator.custom.postfix.swift", + "match": ".+" } ] } - }, + } + }, + { "comment": "Infix operator", - "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t" - }, - { + "match": "(?x)\n\\G # Matching from the beginning ensures\n # that we start with operator-head\n(\n (?!(//|/\\*|\\*/))\n (\n [/=\\-+!*%<>&|^~?] # operator-head\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n \n | [\\x{0300}-\\x{036F}] # operator-character\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n)++", "captures": { "0": { "patterns": [ { - "match": ".+", - "name": "keyword.operator.custom.prefix.dot.swift" - } - ] - } - }, - "comment": "Dot prefix unary operator", - "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?<=^|[\\s(\\[{,;:])\n\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t\t | [/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?![\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t" - }, - { - "captures": { - "0": { - "patterns": [ - { - "match": ".+", - "name": "keyword.operator.custom.postfix.dot.swift" - } - ] - } - }, - "comment": "Dot postfix unary operator", - "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?=[\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t" - }, - { - "captures": { - "0": { - "patterns": [ - { - "match": "\\G\\.\\.[.<]$", - "name": "keyword.operator.range.swift" + "name": "keyword.operator.assignment.swift", + "match": "\\G=$" }, { - "match": ".+", - "name": "keyword.operator.custom.infix.dot.swift" + "name": "keyword.operator.assignment.compound.swift", + "match": "\\G(\\+|\\-|\\*|/|%|<<|>>|&|\\^|\\||&&|\\|\\|)=$" + }, + { + "name": "keyword.operator.arithmetic.swift", + "match": "\\G(\\+|\\-|\\*|/)$" + }, + { + "name": "keyword.operator.arithmetic.overflow.swift", + "match": "\\G&(\\+|\\-|\\*)$" + }, + { + "name": "keyword.operator.arithmetic.remainder.swift", + "match": "\\G%$" + }, + { + "name": "keyword.operator.comparison.swift", + "match": "\\G(==|!=|>|<|>=|<=|~=)$" + }, + { + "name": "keyword.operator.coalescing.swift", + "match": "\\G\\?\\?$" + }, + { + "name": "keyword.operator.logical.swift", + "match": "\\G(&&|\\|\\|)$" + }, + { + "name": "keyword.operator.bitwise.swift", + "match": "\\G(&|\\||\\^|<<|>>)$" + }, + { + "name": "keyword.operator.bitwise.swift", + "match": "\\G(===|!==)$" + }, + { + "name": "keyword.operator.ternary.swift", + "match": "\\G\\?$" + }, + { + "name": "keyword.operator.custom.infix.swift", + "match": ".+" } ] } - }, + } + }, + { + "comment": "Dot prefix unary operator", + "match": "(?x)\n\\G # Matching from the beginning ensures\n # that we start with operator-head\n(?<=^|[\\s(\\[{,;:])\n\\. # dot\n(\n (?!(//|/\\*|\\*/))\n (\n \\. # dot\n | [/=\\-+!*%<>&|^~?] # operator-head\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n \n | [\\x{0300}-\\x{036F}] # operator-character\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n)++\n(?![\\s)\\]},;:]|\\z)", + "captures": { + "0": { + "patterns": [ + { + "name": "keyword.operator.custom.prefix.dot.swift", + "match": ".+" + } + ] + } + } + }, + { + "comment": "Dot postfix unary operator", + "match": "(?x)\n\\G # Matching from the beginning ensures\n # that we start with operator-head\n(?&|^~?] # operator-head\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n \n | [\\x{0300}-\\x{036F}] # operator-character\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n)++\n(?=[\\s)\\]},;:]|\\z)", + "captures": { + "0": { + "patterns": [ + { + "name": "keyword.operator.custom.postfix.dot.swift", + "match": ".+" + } + ] + } + } + }, + { "comment": "Dot infix operator", - "match": "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t\t | [/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t" + "match": "(?x)\n\\G # Matching from the beginning ensures\n # that we start with operator-head\n\\. # dot\n(\n (?!(//|/\\*|\\*/))\n (\n \\. # dot\n | [/=\\-+!*%<>&|^~?] # operator-head\n | [\\x{00A1}-\\x{00A7}]\n | [\\x{00A9}\\x{00AB}]\n | [\\x{00AC}\\x{00AE}]\n | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n | [\\x{2030}-\\x{203E}]\n | [\\x{2041}-\\x{2053}]\n | [\\x{2055}-\\x{205E}]\n | [\\x{2190}-\\x{23FF}]\n | [\\x{2500}-\\x{2775}]\n | [\\x{2794}-\\x{2BFF}]\n | [\\x{2E00}-\\x{2E7F}]\n | [\\x{3001}-\\x{3003}]\n | [\\x{3008}-\\x{3030}]\n \n | [\\x{0300}-\\x{036F}] # operator-character\n | [\\x{1DC0}-\\x{1DFF}]\n | [\\x{20D0}-\\x{20FF}]\n | [\\x{FE00}-\\x{FE0F}]\n | [\\x{FE20}-\\x{FE2F}]\n | [\\x{E0100}-\\x{E01EF}]\n )\n)++", + "captures": { + "0": { + "patterns": [ + { + "name": "keyword.operator.range.swift", + "match": "\\G\\.\\.[.<]$" + }, + { + "name": "keyword.operator.custom.infix.dot.swift", + "match": ".+" + } + ] + } + } } ] }, { - "match": ":", - "name": "keyword.operator.ternary.swift" + "name": "keyword.operator.ternary.swift", + "match": ":" } ] }, diff --git a/plugins/textmate/lib/bundles/terraform/README.md b/plugins/textmate/lib/bundles/terraform/README.md index 4a867a8059c0..11b9d0274f94 100644 --- a/plugins/textmate/lib/bundles/terraform/README.md +++ b/plugins/textmate/lib/bundles/terraform/README.md @@ -25,13 +25,14 @@ Read the [Troubleshooting Guide](#troubleshooting) for answers to common questio - [Syntax highlighting](#syntax-highlighting) Highlighting syntax from Terraform 0.12 to 1.X - [Code Navigation](#code-navigation) Navigate through your codebase with Go to Definition and Symbol support - [Code Formatting](#code-formatting) Format your code with `terraform fmt` automatically -- [Code Snippets](#code-snippets) Shortcuts for commmon snippets like `for_each` and `variable` +- [Code Snippets](#code-snippets) Shortcuts for common snippets like `for_each` and `variable` +- [Terraform Cloud Integration](#terraform-cloud-integration) View Terraform Cloud Workspaces and Run details inside VS Code - [Terraform Module Explorer](#terraform-module-and-provider-explorer) View all modules and providers referenced in the currently open document. - [Terraform commands](#terraform-commands) Directly execute commands like `terraform init` or `terraform plan` from the VS Code Command Palette. ### IntelliSense and Autocomplete -IntelliSense is a general term for a variety of code editing features including: code completion, parameter info, quick info, and member lists. IntelliSense features are sometimes called by other names such as autcomplete, code completion, and code hinting. +IntelliSense is a general term for a variety of code editing features including: code completion, parameter info, quick info, and member lists. IntelliSense features are sometimes called by other names such as autocomplete, code completion, and code hinting. For Terraform constructs like resource and data, labels, blocks and attributes are auto completed both at the root of the document and inside other blocks. This also works for Terraform modules that are installed in the workspace, attributes and other constructs are autocompleted. @@ -114,6 +115,38 @@ The extension provides several snippets to accelerate adding Terraform code to y - `vare` - Empty variable - `varm` - Map Variable +### Terraform Cloud Integration + +Every time you have to switch away from your code, you risk losing momentum and the context about your tasks. Previously, Terraform users needed to have at least two windows open – their editor and a web page – to develop Terraform code. The editor contains all of the Terraform code they are working on, and the web page has the Terraform Cloud workspace loaded. Switching back and forth between the Terraform Cloud website and the text editor can be a frustrating and fragmented experience. + +The Terraform Cloud Visual Studio Code integration improves user experience by allowing users to view workspaces directly from within Visual Studio Code. Users can view the status of current and past runs and inspect detailed logs – without ever leaving the comfort of their editor. + +To start using Terraform Cloud with VS Code, open the new Terraform Cloud sidebar and click "Login to Terraform Cloud". You can login using a stored token from the Terraform CLI, an existing token you provide, or open the Terraform Cloud website to generate a new token. + +![](docs/tfc/login_view.gif) + +Once logged in, you are prompted to choose which Organization to view workspaces in. + +![](docs/tfc/choose_org_view.png) + +Now that your Organization is chosen, the Workspace view populates with all workspaces your token has permission to view. At a glance, you can see the last run status of each Workspace. Hovering over a workspace shows detailed information about each workspace. + +![](docs/tfc/workspace_view.gif) + +Selecting a workspace populates the Run view with a list of runs for that workspace. At a glance, you can see the status of each Run, and hover over each for more detailed information. + +![](docs/tfc/workspace_run_view.gif) + +If a Run has been Planned or Applied, you can view the raw log for each by expanding the Run then selecting the 'View Raw Log' button for either the Plan or Apply. + +![](docs/tfc/plan_apply_view.gif) + +To sign out or log out of your Terraform Cloud session, click the Accounts icon next to the Settings icon in the Activity Bar and select "Sign Out": + +![](docs/tfc/log_out.png) + +This will clear the currently saved token and allow you to login using a different token. + ### Terraform Module and Provider Explorer List Terraform modules used in the current open document in the Explorer Pane, or drag to the Side Bar pane for an expanded view. @@ -145,16 +178,17 @@ The Terraform VS Code extension bundles the [Terraform Language Server](https:// The extension does require the following to be installed before use: -- VS Code v1.75 or greater +- VS Code v1.82 or greater - Terraform v0.12 or greater ## Platform Support The extension should work anywhere VS Code itself and Terraform 0.12 or higher is supported. Our test matrix includes the following: -- Windows Server 2019 with Terraform v1.1 -- macOS 10.15 with Terraform v1.1 -- Ubuntu 20.04 with Terraform v1.1 +- Windows Server 2022 with Terraform v1.6 +- macOS 12 with Terraform v1.6 +- macOS 11 with Terraform v1.6 +- Ubuntu 22.04 with Terraform v1.6 Intellisense, error checking and other language features are supported for Terraform v0.12 and greater. diff --git a/plugins/textmate/lib/bundles/terraform/package.json b/plugins/textmate/lib/bundles/terraform/package.json index c93dc0f6d341..28a71355e6c4 100644 --- a/plugins/textmate/lib/bundles/terraform/package.json +++ b/plugins/textmate/lib/bundles/terraform/package.json @@ -1,6 +1,6 @@ { "name": "terraform", - "version": "2.28.2", + "version": "2.29.4", "description": "Syntax highlighting and autocompletion for Terraform", "license": "MPL-2.0", "contributes": { @@ -89,12 +89,12 @@ "description": "Keyword" }, { - "id": "hcl-traversalStep", + "id": "hcl-referenceStep", "superType": "variable", - "description": "Traversal step" + "description": "Reference step" }, { - "id": "hcl-typeCapsule", + "id": "hcl-typeComplex", "superType": "keyword", "description": "Type (complex)" }, @@ -139,10 +139,10 @@ "hcl-keyword": [ "keyword.control" ], - "hcl-traversalStep": [ + "hcl-referenceStep": [ "variable.other.readwrite" ], - "hcl-typeCapsule": [ + "hcl-typeComplex": [ "keyword.control" ], "hcl-typePrimitive": [ @@ -216,6 +216,15 @@ "description": "Required providers" } ], + "icons": { + "run-status-running": { + "description": "Run Status icon", + "default": { + "fontPath": "./assets/icons/running.woff", + "fontCharacter": "D" + } + } + }, "snippets": [ { "language": "terraform", @@ -354,32 +363,32 @@ "commands": [ { "command": "terraform.generateBugReport", - "title": "Terraform: Generate Bug Report" + "title": "HashiCorp Terraform: Generate Bug Report" }, { "command": "terraform.enableLanguageServer", - "title": "Terraform: Enable Language Server" + "title": "HashiCorp Terraform: Enable Language Server" }, { "command": "terraform.disableLanguageServer", - "title": "Terraform: Disable Language Server" + "title": "HashiCorp Terraform: Disable Language Server" }, { "command": "terraform.init", - "title": "Terraform: init" + "title": "HashiCorp Terraform: init" }, { "command": "terraform.initCurrent", - "title": "Terraform: init current folder", + "title": "HashiCorp Terraform: init current folder", "icon": "$(cloud-download)" }, { "command": "terraform.validate", - "title": "Terraform: validate" + "title": "HashiCorp Terraform: validate" }, { "command": "terraform.plan", - "title": "Terraform: plan" + "title": "HashiCorp Terraform: plan" }, { "command": "terraform.modules.refreshList", @@ -400,6 +409,70 @@ "command": "terraform.providers.openDocumentation", "title": "Open Documentation", "icon": "$(book)" + }, + { + "command": "terraform.cloud.login", + "title": "HashiCorp Terraform Cloud: Login", + "enablement": "terraform.cloud.signed-in === false" + }, + { + "command": "terraform.cloud.workspaces.refresh", + "title": "Refresh", + "icon": "$(refresh)", + "enablement": "terraform.cloud.signed-in" + }, + { + "command": "terraform.cloud.workspaces.viewInBrowser", + "title": "View workspace", + "icon": "$(globe)", + "enablement": "terraform.cloud.signed-in" + }, + { + "command": "terraform.cloud.runs.refresh", + "title": "Refresh", + "icon": "$(refresh)", + "enablement": "terraform.cloud.signed-in" + }, + { + "command": "terraform.cloud.run.viewInBrowser", + "title": "View run", + "icon": "$(globe)", + "enablement": "terraform.cloud.signed-in" + }, + { + "command": "terraform.cloud.run.plan.downloadLog", + "title": "View raw plan log", + "icon": "$(console)", + "enablement": "terraform.cloud.signed-in" + }, + { + "command": "terraform.cloud.run.viewPlan", + "title": "View plan output", + "icon": "$(output)", + "enablement": "terraform.cloud.signed-in" + }, + { + "command": "terraform.cloud.run.apply.downloadLog", + "title": "View raw apply log", + "icon": "$(output)", + "enablement": "terraform.cloud.signed-in" + }, + { + "command": "terraform.cloud.run.viewApply", + "title": "View apply output", + "icon": "$(output)" + }, + { + "command": "terraform.cloud.organization.picker", + "title": "HashiCorp Terraform Cloud: Pick Organization", + "icon": "$(account)", + "enablement": "terraform.cloud.signed-in" + }, + { + "command": "terraform.cloud.workspaces.filterByProject", + "title": "Filter by project", + "icon": "$(filter)", + "enablement": "terraform.cloud.signed-in" } ], "menus": { @@ -443,6 +516,50 @@ { "command": "terraform.providers.openDocumentation", "when": "false" + }, + { + "command": "terraform.cloud.login", + "when": "terraform.cloud.signed-in === false && terraform.cloud.views.visible" + }, + { + "command": "terraform.cloud.organization.picker", + "when": "terraform.cloud.signed-in" + }, + { + "command": "terraform.cloud.workspaces.viewInBrowser", + "when": "false" + }, + { + "command": "terraform.cloud.run.viewInBrowser", + "when": "false" + }, + { + "command": "terraform.cloud.run.plan.downloadLog", + "when": "false" + }, + { + "command": "terraform.cloud.run.viewPlan", + "when": "false" + }, + { + "command": "terraform.cloud.runs.refresh", + "when": "false" + }, + { + "command": "terraform.cloud.run.apply.downloadLog", + "when": "false" + }, + { + "command": "terraform.cloud.run.viewApply", + "when": "false" + }, + { + "command": "terraform.cloud.workspaces.filterByProject", + "when": "false" + }, + { + "command": "terraform.cloud.workspaces.refresh", + "when": "false" } ], "view/title": [ @@ -460,6 +577,26 @@ "command": "terraform.initCurrent", "when": "view == terraform.providers", "group": "navigation" + }, + { + "command": "terraform.cloud.workspaces.filterByProject", + "when": "view == terraform.cloud.workspaces", + "group": "navigation" + }, + { + "command": "terraform.cloud.organization.picker", + "when": "view == terraform.cloud.workspaces", + "group": "navigation" + }, + { + "command": "terraform.cloud.workspaces.refresh", + "when": "view == terraform.cloud.workspaces", + "group": "navigation" + }, + { + "command": "terraform.cloud.runs.refresh", + "when": "view == terraform.cloud.runs", + "group": "navigation" } ], "view/item/context": [ @@ -470,6 +607,36 @@ { "command": "terraform.providers.openDocumentation", "when": "view == terraform.providers && viewItem == moduleProviderHasDocs" + }, + { + "command": "terraform.cloud.workspaces.viewInBrowser", + "when": "view == terraform.cloud.workspaces && viewItem =~ /hasLink/", + "group": "inline" + }, + { + "command": "terraform.cloud.run.viewInBrowser", + "when": "view == terraform.cloud.runs && viewItem =~ /isRun/", + "group": "inline" + }, + { + "command": "terraform.cloud.run.plan.downloadLog", + "when": "view == terraform.cloud.runs && viewItem =~ /hasRawPlan/", + "group": "inline" + }, + { + "command": "terraform.cloud.run.viewPlan", + "when": "view == terraform.cloud.runs && viewItem =~ /hasStructuredPlan/", + "group": "inline" + }, + { + "command": "terraform.cloud.run.apply.downloadLog", + "when": "view == terraform.cloud.runs && viewItem =~ /hasRawApply/", + "group": "inline" + }, + { + "command": "terraform.cloud.run.viewApply", + "when": "view == terraform.cloud.runs && viewItem =~ /hasStructuredApply/", + "group": "inline" } ] }, @@ -483,6 +650,30 @@ "id": "terraform.modules", "name": "Module Calls" } + ], + "terraform-cloud": [ + { + "id": "terraform.cloud.workspaces", + "name": "Workspaces", + "contextualTitle": "Terraform Cloud workspaces" + }, + { + "id": "terraform.cloud.runs", + "name": "Runs", + "contextualTitle": "Terraform Cloud runs" + } + ], + "terraform-cloud-panel": [ + { + "id": "terraform.cloud.run.plan", + "name": "Plan", + "when": "terraform.cloud.run.viewingPlan" + }, + { + "id": "terraform.cloud.run.apply", + "name": "Apply", + "when": "terraform.cloud.run.viewingApply" + } ] }, "viewsContainers": { @@ -490,18 +681,114 @@ { "id": "terraform", "title": "HashiCorp Terraform", - "icon": "assets/icons/terraform.svg" + "icon": "assets/icons/vs_code_terraform.svg" + }, + { + "id": "terraform-cloud", + "title": "HashiCorp Terraform Cloud", + "icon": "assets/icons/vs_code_terraform_cloud.svg" + } + ], + "panel": [ + { + "id": "terraform-cloud-panel", + "title": "Terraform Cloud", + "icon": "assets/icons/vs_code_terraform_cloud.svg" } ] }, "viewsWelcome": [ { "view": "terraform.providers", - "contents": "The active editor cannot provide information about installed providers. [Learn more about providers](https://www.terraform.io/docs/language/providers/index.html). You may need to update your language server version." + "contents": "This view requires the language server to be enabled:\n[Open Settings](command:terraform.openSettingsJson)", + "when": "config.terraform.languageServer.enable === false" + }, + { + "view": "terraform.providers", + "contents": "There are no open Terraform files. Please open a Terraform configuration file to see installed providers.", + "when": "config.terraform.languageServer.enable && terraform.providers.documentOpened === false" + }, + { + "view": "terraform.providers", + "contents": "The active document is not a Terraform file. Please open a Terraform configuration file to see installed providers.", + "when": "config.terraform.languageServer.enable && terraform.providers.documentIsTerraform === false" + }, + { + "view": "terraform.providers", + "contents": "There are no installed providers found for the current open file.\n[Learn more about providers](https://www.terraform.io/docs/language/providers/index.html)", + "when": "config.terraform.languageServer.enable && terraform.providers.noProviders === true" + }, + { + "view": "terraform.providers", + "contents": "The active editor cannot provide information about installed providers.\n[Learn more about providers](https://www.terraform.io/docs/language/providers/index.html)", + "when": "config.terraform.languageServer.enable && terraform.providers.noResponse === true" }, { "view": "terraform.modules", - "contents": "The active editor cannot provide information about installed modules. [Learn more about modules](https://www.terraform.io/docs/language/modules/develop/index.html) You may need to run 'terraform get' or update your language server version." + "contents": "This view requires the language server to be enabled:\n[Open Settings](command:terraform.openSettingsJson)", + "when": "config.terraform.languageServer.enable === false" + }, + { + "view": "terraform.modules", + "contents": "There are no open Terraform files. Please open a Terraform configuration file to see installed modules.", + "when": "config.terraform.languageServer.enable && terraform.modules.documentOpened === false" + }, + { + "view": "terraform.modules", + "contents": "The active document is not a Terraform file. Please open a Terraform configuration file to see installed modules.", + "when": "config.terraform.languageServer.enable && terraform.modules.documentIsTerraform === false" + }, + { + "view": "terraform.modules", + "contents": "There are no installed modules found for the current open file.\n[Learn more about modules](https://www.terraform.io/docs/language/modules/develop/index.html)", + "when": "config.terraform.languageServer.enable && terraform.modules.noModules === true" + }, + { + "view": "terraform.modules", + "contents": "The active editor cannot provide information about installed modules.\n[Learn more about modules](https://www.terraform.io/docs/language/modules/develop/index.html)", + "when": "config.terraform.languageServer.enable && terraform.modules.noResponse === true" + }, + { + "view": "terraform.cloud.workspaces", + "contents": "In order to use Terraform Cloud features, you need to be logged in\n[Login to Terraform Cloud](command:terraform.cloud.login)", + "when": "terraform.cloud.signed-in === false" + }, + { + "view": "terraform.cloud.workspaces", + "contents": "No organizations found for this token. Please create a new Terraform Cloud organization to get started\n[Create or select an organization](command:terraform.cloud.organization.picker)", + "when": "terraform.cloud.signed-in && !terraform.cloud.organizationsExist && !terraform.cloud.organizationsChosen" + }, + { + "view": "terraform.cloud.workspaces", + "contents": "Please choose an organization:\n[Select a organization](command:terraform.cloud.organization.picker)", + "when": "terraform.cloud.signed-in && terraform.cloud.organizationsExist && !terraform.cloud.organizationsChosen" + }, + { + "view": "terraform.cloud.workspaces", + "contents": "There are no workspaces in this organization.\n[Create a new workspace](command:terraform.cloud.workspaces.picker)\n[Choose a different organization](command:terraform.cloud.organization.picker)", + "when": "terraform.cloud.signed-in && terraform.cloud.organizationsExist && terraform.cloud.organizationsChosen && !terraform.cloud.projectFilterUsed && !terraform.cloud.workspacesExist && !terraform.cloud.pendingOrgMembership" + }, + { + "view": "terraform.cloud.workspaces", + "contents": "You have not yet accepted the invitation to this organization\n[See pending invitations](command:terraform.cloud.organization.viewInBrowser)\n[Choose a different organization](command:terraform.cloud.organization.picker)", + "when": "terraform.cloud.signed-in && terraform.cloud.organizationsExist && terraform.cloud.organizationsChosen && !terraform.cloud.projectFilterUsed && !terraform.cloud.workspacesExist && terraform.cloud.pendingOrgMembership" + }, + { + "view": "terraform.cloud.workspaces", + "contents": "There are no workspaces in this project\n[Create a new workspace](command:terraform.cloud.workspaces.picker)\n[Clear filter](command:terraform.cloud.workspaces.resetProjectFilter)", + "when": "terraform.cloud.signed-in && terraform.cloud.organizationsExist && terraform.cloud.organizationsChosen && terraform.cloud.projectFilterUsed && !terraform.cloud.workspacesExist" + }, + { + "view": "terraform.cloud.runs", + "contents": "Select a workspace to view a list of runs" + }, + { + "view": "terraform.cloud.run.plan", + "contents": "Select a run to view a plan" + }, + { + "view": "terraform.cloud.run.apply", + "contents": "Select a run to view an apply" } ] } diff --git a/plugins/textmate/lib/bundles/terraform/syntaxes/terraform.tmGrammar.json b/plugins/textmate/lib/bundles/terraform/syntaxes/terraform.tmGrammar.json index 6e165bb13f18..7950b0b664f0 100644 --- a/plugins/textmate/lib/bundles/terraform/syntaxes/terraform.tmGrammar.json +++ b/plugins/textmate/lib/bundles/terraform/syntaxes/terraform.tmGrammar.json @@ -284,15 +284,19 @@ }, "functions": { "name": "meta.function-call.hcl", - "begin": "(\\w+)(\\()", + "begin": "([:\\-\\w]+)(\\()", "end": "\\)", "comment": "Built-in function calls", "beginCaptures": { "1": { "patterns": [ { - "match": "\\b(abs|abspath|alltrue|anytrue|base64decode|base64encode|base64gzip|base64sha256|base64sha512|basename|bcrypt|can|ceil|chomp|chunklist|cidrhost|cidrnetmask|cidrsubnet|cidrsubnets|coalesce|coalescelist|compact|concat|contains|csvdecode|dirname|distinct|element|endswith|file|filebase64|filebase64sha256|filebase64sha512|fileexists|filemd5|fileset|filesha1|filesha256|filesha512|flatten|floor|format|formatdate|formatlist|indent|index|join|jsondecode|jsonencode|keys|length|log|lookup|lower|matchkeys|max|md5|merge|min|nonsensitive|one|parseint|pathexpand|plantimestamp|pow|range|regex|regexall|replace|reverse|rsadecrypt|sensitive|setintersection|setproduct|setsubtract|setunion|sha1|sha256|sha512|signum|slice|sort|split|startswith|strcontains|strrev|substr|sum|templatefile|textdecodebase64|textencodebase64|timeadd|timecmp|timestamp|title|tobool|tolist|tomap|tonumber|toset|tostring|transpose|trim|trimprefix|trimspace|trimsuffix|try|upper|urlencode|uuid|uuidv5|values|yamldecode|yamlencode|zipmap)\\b", + "match": "\\b(core::)?(abs|abspath|alltrue|anytrue|base64decode|base64encode|base64gzip|base64sha256|base64sha512|basename|bcrypt|can|ceil|chomp|chunklist|cidrhost|cidrnetmask|cidrsubnet|cidrsubnets|coalesce|coalescelist|compact|concat|contains|csvdecode|dirname|distinct|element|endswith|file|filebase64|filebase64sha256|filebase64sha512|fileexists|filemd5|fileset|filesha1|filesha256|filesha512|flatten|floor|format|formatdate|formatlist|indent|index|join|jsondecode|jsonencode|keys|length|log|lookup|lower|matchkeys|max|md5|merge|min|nonsensitive|one|parseint|pathexpand|plantimestamp|pow|range|regex|regexall|replace|reverse|rsadecrypt|sensitive|setintersection|setproduct|setsubtract|setunion|sha1|sha256|sha512|signum|slice|sort|split|startswith|strcontains|strrev|substr|sum|templatefile|textdecodebase64|textencodebase64|timeadd|timecmp|timestamp|title|tobool|tolist|tomap|tonumber|toset|tostring|transpose|trim|trimprefix|trimspace|trimsuffix|try|upper|urlencode|uuid|uuidv5|values|yamldecode|yamlencode|zipmap)\\b", "name": "support.function.builtin.terraform" + }, + { + "match": "\\bprovider::[[:alpha:]][\\w_-]*::[[:alpha:]][\\w_-]*\\b", + "name": "support.function.provider.terraform" } ] }, diff --git a/plugins/textmate/lib/bundles/twig/README.md b/plugins/textmate/lib/bundles/twig/README.md index 6e94c659be49..5a48e1663171 100644 --- a/plugins/textmate/lib/bundles/twig/README.md +++ b/plugins/textmate/lib/bundles/twig/README.md @@ -43,6 +43,10 @@ Install through Visual Studio Code extensions. Search for `Twig Language 2` [Visual Studio Code Market Place: Twig Language 2](https://marketplace.visualstudio.com/items?itemName=mblode.twig-language-2) +## Configuration + +Restart VS Code after making changes to Twig Language 2 extension settings. + ## Documentation Twig Language 2 is a Visual Studio Code extension that provides snippets, syntax highlighting, hover, and formatting for the Twig file format. diff --git a/plugins/textmate/lib/bundles/twig/package.json b/plugins/textmate/lib/bundles/twig/package.json index 48078e06f801..35d03a1f9918 100644 --- a/plugins/textmate/lib/bundles/twig/package.json +++ b/plugins/textmate/lib/bundles/twig/package.json @@ -1,6 +1,6 @@ { "name": "twig-language-2", - "version": "0.9.2", + "version": "0.9.4", "description": "Snippets, Syntax Highlighting, Hover, and Formatting for Twig", "license": "MIT", "contributes": { @@ -160,7 +160,7 @@ "tab" ], "default": "tab", - "description": "Choose to indent using tabs or spaces." + "description": "Choose to indent using tabs or spaces. This formatter will not use the \"Editor: Insert Spaces\" setting, nor will it use the `indent_style` setting declared in `.editorconfig` files." }, "twig-language-2.indentLevel": { "type": "integer", @@ -170,7 +170,7 @@ "twig-language-2.tabSize": { "type": "integer", "default": 0, - "description": "0 will default to the editor's tab size. Stores the number of 'inchar' values to comprise a single indentation." + "description": "0 will default to the editor's tab size (`editor.tabSize`). This formatter will not use the `indent_size` setting declared in `.editorconfig` files." }, "twig-language-2.methodChain": { "type": "integer", diff --git a/plugins/textmate/lib/bundles/twig/snippets/snippets.json b/plugins/textmate/lib/bundles/twig/snippets/snippets.json index fefdbeb586fe..bab20bf25ee6 100644 --- a/plugins/textmate/lib/bundles/twig/snippets/snippets.json +++ b/plugins/textmate/lib/bundles/twig/snippets/snippets.json @@ -1,4 +1,10 @@ { + "apply": { + "prefix": "apply", + "body": "{% apply %}\n\t$0\n{% endapply %}", + "description": "apply", + "scope": "text.html.twig" + }, "asset": { "prefix": "asset", "body": @@ -251,12 +257,24 @@ "description": "else", "scope": "text.html.twig" }, + "elseif": { + "prefix": "elseif", + "body": "{% elseif %}\n\t$0", + "description": "elseif", + "scope": "text.html.twig" + }, "embed": { "prefix": "embed", "body": "{% embed \"${1:template}\" %}\n\t$0\n{% endembed %}", "description": "embed", "scope": "text.html.twig" }, + "endapply": { + "prefix": "endapply", + "body": "{% endapply %}$0", + "description": "endapply", + "scope": "text.html.twig" + }, "endautoescape": { "prefix": "endautoescape", "body": "{% endautoescape %}$0", diff --git a/plugins/textmate/lib/bundles/twig/src/snippets/snippets.json b/plugins/textmate/lib/bundles/twig/src/snippets/snippets.json index fefdbeb586fe..bab20bf25ee6 100644 --- a/plugins/textmate/lib/bundles/twig/src/snippets/snippets.json +++ b/plugins/textmate/lib/bundles/twig/src/snippets/snippets.json @@ -1,4 +1,10 @@ { + "apply": { + "prefix": "apply", + "body": "{% apply %}\n\t$0\n{% endapply %}", + "description": "apply", + "scope": "text.html.twig" + }, "asset": { "prefix": "asset", "body": @@ -251,12 +257,24 @@ "description": "else", "scope": "text.html.twig" }, + "elseif": { + "prefix": "elseif", + "body": "{% elseif %}\n\t$0", + "description": "elseif", + "scope": "text.html.twig" + }, "embed": { "prefix": "embed", "body": "{% embed \"${1:template}\" %}\n\t$0\n{% endembed %}", "description": "embed", "scope": "text.html.twig" }, + "endapply": { + "prefix": "endapply", + "body": "{% endapply %}$0", + "description": "endapply", + "scope": "text.html.twig" + }, "endautoescape": { "prefix": "endautoescape", "body": "{% endautoescape %}$0", diff --git a/plugins/textmate/lib/bundles/twig/src/syntaxes/twig.tmLanguage b/plugins/textmate/lib/bundles/twig/src/syntaxes/twig.tmLanguage index 27e8152ca714..8ec88c69f670 100644 --- a/plugins/textmate/lib/bundles/twig/src/syntaxes/twig.tmLanguage +++ b/plugins/textmate/lib/bundles/twig/src/syntaxes/twig.tmLanguage @@ -416,6 +416,25 @@ + + begin + (?ix) # Enable free spacing mode, case insensitive + (?<=\{\%\sscss\s\%\}|\{\%\sincludescss\s\%\}|\{\%\sincludehiresscss\s\%\}) + + comment + Add SCSS support to set tags that use the pattern "scss" in their name + end + (?ix)(?=\{\%\sendscss\s\%\}|\{\%\sendincludescss\s\%\}|\{\%\sendincludehiresscss\s\%\}) + name + source.css.scss.embedded.twig + patterns + + + include + source.css.scss + + + begin (</?)((?i:body|head|html)\b) @@ -951,7 +970,7 @@ match - (?<=\s)(\?|:|and|not|or)(?=\s) + (?<=\s)(\?|:|\?:|\?\?|and|not|or)(?=\s) @@ -1277,6 +1296,10 @@ include #twig-constants + + include + #twig-operators + include #twig-strings @@ -1365,6 +1388,10 @@ include #twig-constants + + include + #twig-operators + include #twig-strings @@ -1672,6 +1699,10 @@ include #twig-constants + + include + #twig-operators + include #twig-functions-warg diff --git a/plugins/textmate/lib/bundles/typescript-basics/cgmanifest.json b/plugins/textmate/lib/bundles/typescript-basics/cgmanifest.json deleted file mode 100644 index 4b7b1b2d37ac..000000000000 --- a/plugins/textmate/lib/bundles/typescript-basics/cgmanifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "TypeScript-TmLanguage", - "repositoryUrl": "https://github.com/microsoft/TypeScript-TmLanguage", - "commitHash": "8c7482b94b548eab56da64dbfb30b82589b3f747" - } - }, - "license": "MIT", - "description": "The files syntaxes/TypeScript.tmLanguage.json and syntaxes/TypeScriptReact.tmLanguage.json were derived from TypeScript.tmLanguage and TypeScriptReact.tmLanguage in https://github.com/microsoft/TypeScript-TmLanguage.", - "version": "1.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/typescript-basics/language-configuration.json b/plugins/textmate/lib/bundles/typescript-basics/language-configuration.json index 03f06fa04d53..2d14b1cab196 100644 --- a/plugins/textmate/lib/bundles/typescript-basics/language-configuration.json +++ b/plugins/textmate/lib/bundles/typescript-basics/language-configuration.json @@ -129,14 +129,14 @@ }, "indentationRules": { "decreaseIndentPattern": { - "pattern": "^((?!.*?/\\*).*\\*\/)?\\s*[\\}\\]].*$" + "pattern": "^((?!.*?/\\*).*\\*\/)?\\s*[\\}\\]\\)].*$" }, "increaseIndentPattern": { "pattern": "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$" }, // e.g. * ...| or */| or *-----*/| "unIndentedLinePattern": { - "pattern": "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$" + "pattern": "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$" } }, "onEnterRules": [ @@ -166,7 +166,7 @@ { // e.g. * ...| "beforeText": { - "pattern": "^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$" + "pattern": "^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$" }, "previousLineText": { "pattern": "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))" diff --git a/plugins/textmate/lib/bundles/typescript-basics/syntaxes/TypeScript.tmLanguage.json b/plugins/textmate/lib/bundles/typescript-basics/syntaxes/TypeScript.tmLanguage.json index 81eeb5b5d961..8566822e7db8 100644 --- a/plugins/textmate/lib/bundles/typescript-basics/syntaxes/TypeScript.tmLanguage.json +++ b/plugins/textmate/lib/bundles/typescript-basics/syntaxes/TypeScript.tmLanguage.json @@ -4,7 +4,7 @@ "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/microsoft/TypeScript-TmLanguage/commit/8c7482b94b548eab56da64dbfb30b82589b3f747", + "version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/b80b7509a78e642f789c567e144ed951ab98b4e3", "name": "TypeScript", "scopeName": "source.ts", "patterns": [ @@ -2348,12 +2348,15 @@ ] }, "import-export-assert-clause": { - "begin": "(?", "notIn": [ "comment", "string" ]}, - { "open": "", "notIn": [ "comment", "string" ]} + { "open": "", "notIn": [ "comment", "string" ]} ], "surroundingPairs": [ { "open": "'", "close": "'" }, diff --git a/plugins/textmate/lib/bundles/yaml/cgmanifest.json b/plugins/textmate/lib/bundles/yaml/cgmanifest.json deleted file mode 100644 index e6c3ca158b58..000000000000 --- a/plugins/textmate/lib/bundles/yaml/cgmanifest.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "registrations": [ - { - "component": { - "type": "git", - "git": { - "name": "textmate/yaml.tmbundle", - "repositoryUrl": "https://github.com/textmate/yaml.tmbundle", - "commitHash": "e54ceae3b719506dba7e481a77cea4a8b576ae46" - } - }, - "licenseDetail": [ - "Copyright (c) 2015 FichteFoll ", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and associated documentation files (the \"Software\"), to deal", - "in the Software without restriction, including without limitation the rights", - "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", - "copies of the Software, and to permit persons to whom the Software is", - "furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in all", - "copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", - "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", - "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", - "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." - ], - "license": "TextMate Bundle License", - "version": "0.0.0" - } - ], - "version": 1 -} \ No newline at end of file diff --git a/plugins/textmate/lib/bundles/yaml/package.json b/plugins/textmate/lib/bundles/yaml/package.json index 3e439eaab0c3..303d3a900c13 100644 --- a/plugins/textmate/lib/bundles/yaml/package.json +++ b/plugins/textmate/lib/bundles/yaml/package.json @@ -28,11 +28,14 @@ "yaml" ], "extensions": [ + ".yaml", ".yml", ".eyaml", ".eyml", - ".yaml", - ".cff" + ".cff", + ".yaml-tmlanguage", + ".yaml-tmpreferences", + ".yaml-tmtheme" ], "firstLine": "^#cloud-config", "configuration": "./language-configuration.json" diff --git a/plugins/textmate/loadVSCBundles.sh b/plugins/textmate/loadVSCBundles.sh index d623e893d8bc..99ff38c176eb 100755 --- a/plugins/textmate/loadVSCBundles.sh +++ b/plugins/textmate/loadVSCBundles.sh @@ -31,6 +31,7 @@ for f in *; do rm -rf "$ROOT/lib/bundles/$f/src" rm -rf "$ROOT/lib/bundles/$f/resources" rm -rf "$ROOT/lib/bundles/$f/yarn.lock" + rm -rf "$ROOT/lib/bundles/$f/cgmanifest.json" find "$ROOT/lib/bundles/$f/" -name "*.js" -type f -delete find "$ROOT/lib/bundles/$f/" -name "*.ts" -type f -delete find "$ROOT/lib/bundles/$f/" -name "*.png" -type f -delete @@ -40,7 +41,7 @@ cd ../.. # vim script echo "Adding vim script" -git clone git@github.com:AlexPl292/language-viml.git +git clone https://github.com/AlexPl292/language-viml cd language-viml mkdir -p "$ROOT/lib/bundles/viml" diff --git a/plugins/textmate/testData/lexer/go/test_after.go b/plugins/textmate/testData/lexer/go/test_after.go index 0630f1172230..b26bc5159912 100644 --- a/plugins/textmate/testData/lexer/go/test_after.go +++ b/plugins/textmate/testData/lexer/go/test_after.go @@ -1,6 +1,6 @@ source.go;keyword.package.go: [0, 7], {package} source.go: [7, 8], { } -source.go;entity.name.package.go: [8, 12], {main} +source.go;entity.name.type.package.go: [8, 12], {main} source.go: [12, 13], { } source.go: [13, 14], { @@ -10,8 +10,10 @@ source.go: [17, 18], { } source.go;variable.other.assignment.go: [18, 21], {log} source.go: [21, 22], { } source.go;keyword.operator.address.go: [22, 23], {*} -source.go: [23, 30], {zerolog} +source.go;entity.name.type.go: [23, 30], {zerolog} source.go;punctuation.other.period.go: [30, 31], {.} -source.go: [31, 38], {Logger } -source.go: [38, 40], {= } +source.go;entity.name.type.go: [31, 37], {Logger} +source.go: [37, 38], { } +source.go;keyword.operator.assignment.go: [38, 39], {=} +source.go: [39, 40], { } source.go;constant.language.go: [40, 43], {nil} \ No newline at end of file