From c8fdd1650c06321d687ddfd1eff06aae4b616256 Mon Sep 17 00:00:00 2001 From: Dmitriy Vasyura Date: Thu, 8 Jan 2026 17:24:04 +0100 Subject: [PATCH] Update TextMate grammars from upstream sources (#286560) * Update TextMate grammars from upstream sources * Fix integration test on Windows to run TypeScript file directly * Baseline update --- build/npm/update-all-grammars.ts | 2 +- extensions/csharp/cgmanifest.json | 2 +- .../csharp/syntaxes/csharp.tmLanguage.json | 153 +++++++++++++-- extensions/go/cgmanifest.json | 4 +- extensions/go/syntaxes/go.tmLanguage.json | 5 +- .../json/syntaxes/snippets.tmLanguage.json | 18 +- extensions/latex/cgmanifest.json | 4 +- .../latex/syntaxes/LaTeX.tmLanguage.json | 63 ++++-- .../markdown-latex-combined.tmLanguage.json | 184 +++++++++++++++++- extensions/lua/cgmanifest.json | 2 +- extensions/lua/syntaxes/lua.tmLanguage.json | 35 +++- extensions/php/cgmanifest.json | 2 +- extensions/php/syntaxes/php.tmLanguage.json | 8 +- extensions/razor/cgmanifest.json | 2 +- .../razor/syntaxes/cshtml.tmLanguage.json | 155 +++++++++++++-- extensions/sql/build/update-grammar.mjs | 2 +- extensions/sql/cgmanifest.json | 2 +- extensions/sql/syntaxes/sql.tmLanguage.json | 4 +- .../colorize-results/issue-28354_php.json | 2 +- scripts/test.bat | 2 +- 20 files changed, 565 insertions(+), 86 deletions(-) diff --git a/build/npm/update-all-grammars.ts b/build/npm/update-all-grammars.ts index aae11ae1326..b085967f0de 100644 --- a/build/npm/update-all-grammars.ts +++ b/build/npm/update-all-grammars.ts @@ -33,7 +33,7 @@ async function main() { // run integration tests if (process.platform === 'win32') { - _spawn('.\\scripts\\test-integration.bat', [], { env: process.env, stdio: 'inherit' }); + _spawn('.\\scripts\\test-integration.bat', [], { shell: true, env: process.env, stdio: 'inherit' }); } else { _spawn('/bin/bash', ['./scripts/test-integration.sh'], { env: process.env, stdio: 'inherit' }); } diff --git a/extensions/csharp/cgmanifest.json b/extensions/csharp/cgmanifest.json index 61e941c3488..6eb3de2f572 100644 --- a/extensions/csharp/cgmanifest.json +++ b/extensions/csharp/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "dotnet/csharp-tmLanguage", "repositoryUrl": "https://github.com/dotnet/csharp-tmLanguage", - "commitHash": "965478e687f08d3b2ee4fe17104d3f41638bdca2" + "commitHash": "2e6860d87d4019b0b793b1e21e9e5c82185a01aa" } }, "license": "MIT", diff --git a/extensions/csharp/syntaxes/csharp.tmLanguage.json b/extensions/csharp/syntaxes/csharp.tmLanguage.json index b360a96cb65..89b08d5c5b2 100644 --- a/extensions/csharp/syntaxes/csharp.tmLanguage.json +++ b/extensions/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/965478e687f08d3b2ee4fe17104d3f41638bdca2", + "version": "https://github.com/dotnet/csharp-tmLanguage/commit/2e6860d87d4019b0b793b1e21e9e5c82185a01aa", "name": "C#", "scopeName": "source.cs", "patterns": [ @@ -118,9 +118,15 @@ { "include": "#type-declarations" }, + { + "include": "#constructor-declaration" + }, { "include": "#property-declaration" }, + { + "include": "#fixed-size-buffer-declaration" + }, { "include": "#field-declaration" }, @@ -133,9 +139,6 @@ { "include": "#variable-initializer" }, - { - "include": "#constructor-declaration" - }, { "include": "#destructor-declaration" }, @@ -334,6 +337,12 @@ { "include": "#is-expression" }, + { + "include": "#boolean-literal" + }, + { + "include": "#null-literal" + }, { "include": "#anonymous-method-expression" }, @@ -477,7 +486,7 @@ ] }, "attribute-section": { - "begin": "(\\[)(assembly|module|field|event|method|param|property|return|type)?(\\:)?", + "begin": "(\\[)(assembly|module|field|event|method|param|property|return|typevar|type)?(\\:)?", "beginCaptures": { "1": { "name": "punctuation.squarebracket.open.cs" @@ -1025,6 +1034,9 @@ }, "end": "(?=\\{|where|;)", "patterns": [ + { + "include": "#base-class-constructor-call" + }, { "include": "#type" }, @@ -1036,6 +1048,33 @@ } ] }, + "base-class-constructor-call": { + "begin": "(?x)\n(?:\n (@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\.) # qualified name part\n)*\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # type name\n(\n <\n (?\n [^<>()]|\n \\((?:[^<>()]|<[^<>()]*>|\\([^<>()]*\\))*\\)|\n <\\g*>\n )*\n >\\s*\n)? # optional type arguments\n(?=\\() # followed by argument list", + "beginCaptures": { + "1": { + "name": "entity.name.type.cs" + }, + "2": { + "name": "punctuation.accessor.cs" + }, + "3": { + "name": "entity.name.type.cs" + }, + "4": { + "patterns": [ + { + "include": "#type-arguments" + } + ] + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#argument-list" + } + ] + }, "generic-constraints": { "begin": "(where)\\s+(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)", "beginCaptures": { @@ -1096,6 +1135,33 @@ } ] }, + "fixed-size-buffer-declaration": { + "begin": "(?x)\n\\b(fixed)\\b\\s+\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 )\n)\\s+\n(\\g)\\s* # buffer name\n(?=\\[)", + "beginCaptures": { + "1": { + "name": "storage.modifier.fixed.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "6": { + "name": "entity.name.variable.field.cs" + } + }, + "end": "(?=;)", + "patterns": [ + { + "include": "#bracketed-argument-list" + }, + { + "include": "#comment" + } + ] + }, "field-declaration": { "begin": "(?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(\\g)\\s* # first field name\n(?!=>|==)(?=,|;|=|$)", "beginCaptures": { @@ -1302,10 +1368,13 @@ "match": "\\b(private|protected|internal)\\b" }, { - "begin": "\\b(get)\\b\\s*(?=\\{|;|=>|//|/\\*|$)", + "begin": "(?:\\b(readonly)\\s+)?\\b(get)\\b\\s*(?=\\{|;|=>|//|/\\*|$)", "beginCaptures": { "1": { - "name": "storage.type.accessor.$1.cs" + "name": "storage.modifier.readonly.cs" + }, + "2": { + "name": "storage.type.accessor.get.cs" } }, "end": "(?<=\\}|;)|(?=\\})", @@ -1511,17 +1580,14 @@ ] }, "constructor-declaration": { - "begin": "(?=@?[_[:alpha:]][_[:alnum:]]*\\s*\\()", + "begin": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(?=\\(|$)", + "beginCaptures": { + "1": { + "name": "entity.name.function.cs" + } + }, "end": "(?<=\\})|(?=;)", "patterns": [ - { - "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\b", - "captures": { - "1": { - "name": "entity.name.function.cs" - } - } - }, { "begin": "(:)", "beginCaptures": { @@ -2661,6 +2727,15 @@ }, { "include": "#local-variable-declaration" + }, + { + "include": "#local-tuple-var-deconstruction" + }, + { + "include": "#tuple-deconstruction-assignment" + }, + { + "include": "#expression" } ] }, @@ -3045,11 +3120,14 @@ }, { "include": "#local-tuple-var-deconstruction" + }, + { + "include": "#local-tuple-declaration-deconstruction" } ] }, "local-variable-declaration": { - "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(?=,|;|=|\\))", + "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*)* # pointer suffix?\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(?=,|;|=|\\))", "beginCaptures": { "1": { "name": "storage.modifier.ref.cs" @@ -3193,6 +3271,18 @@ } ] }, + "local-tuple-declaration-deconstruction": { + "match": "(?x) # e.g. (int x, var y) = GetPoint();\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?!=>|==)(?==)", + "captures": { + "1": { + "patterns": [ + { + "include": "#tuple-declaration-deconstruction-element-list" + } + ] + } + } + }, "tuple-deconstruction-assignment": { "match": "(?x)\n(?\\s*\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?!=>|==)(?==)", "captures": { @@ -4355,7 +4445,7 @@ } }, "array-creation-expression": { - "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(?=\\[)", + "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*)* # pointer suffix?\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.operator.expression.$1.cs" @@ -5204,7 +5294,7 @@ "end": "(?<=$)", "patterns": [ { - "include": "#comment" + "include": "#preprocessor-comment" }, { "include": "#preprocessor-define-or-undef" @@ -5244,6 +5334,29 @@ } ] }, + "preprocessor-comment": { + "patterns": [ + { + "name": "comment.line.double-slash.cs", + "match": "(//).*(?=$)", + "captures": { + "1": { + "name": "punctuation.definition.comment.cs" + } + } + }, + { + "name": "comment.block.cs", + "begin": "/\\*", + "end": "\\*/", + "captures": { + "0": { + "name": "punctuation.definition.comment.cs" + } + } + } + ] + }, "preprocessor-define-or-undef": { "match": "\\b(?:(define)|(undef))\\b\\s*\\b([_[:alpha:]][_[:alnum:]]*)\\b", "captures": { @@ -5271,7 +5384,7 @@ "end": "(?=$)", "patterns": [ { - "include": "#comment" + "include": "#preprocessor-comment" }, { "include": "#preprocessor-expression" diff --git a/extensions/go/cgmanifest.json b/extensions/go/cgmanifest.json index d41f8a2672d..b697426969b 100644 --- a/extensions/go/cgmanifest.json +++ b/extensions/go/cgmanifest.json @@ -6,12 +6,12 @@ "git": { "name": "go-syntax", "repositoryUrl": "https://github.com/worlpaker/go-syntax", - "commitHash": "8c70c078f56d237f72574ce49cc95839c4f8a741" + "commitHash": "6e8421faf8f1445512825f63925e54a62106bcf1" } }, "license": "MIT", "description": "The file syntaxes/go.tmLanguage.json is from https://github.com/worlpaker/go-syntax, which in turn was derived from https://github.com/jeff-hykin/better-go-syntax.", - "version": "0.8.4" + "version": "0.8.5" } ], "version": 1 diff --git a/extensions/go/syntaxes/go.tmLanguage.json b/extensions/go/syntaxes/go.tmLanguage.json index e83763a8eb5..72d7df0cb40 100644 --- a/extensions/go/syntaxes/go.tmLanguage.json +++ b/extensions/go/syntaxes/go.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/worlpaker/go-syntax/commit/8c70c078f56d237f72574ce49cc95839c4f8a741", + "version": "https://github.com/worlpaker/go-syntax/commit/6e8421faf8f1445512825f63925e54a62106bcf1", "name": "Go", "scopeName": "source.go", "patterns": [ @@ -2487,6 +2487,9 @@ { "include": "#struct_variables_types" }, + { + "include": "#support_functions" + }, { "include": "#type-declarations" }, diff --git a/extensions/json/syntaxes/snippets.tmLanguage.json b/extensions/json/syntaxes/snippets.tmLanguage.json index fd22457a797..289bc18f8c6 100644 --- a/extensions/json/syntaxes/snippets.tmLanguage.json +++ b/extensions/json/syntaxes/snippets.tmLanguage.json @@ -46,7 +46,7 @@ "name": "constant.character.escape.json.comments.snippets" }, "bnf_any": { - "match": "(?:\\}|((?:(?:(?:(?:(?:(?:((?:(\\$)([0-9]+)))|((?:(?:(\\$)(\\{))([0-9]+)(\\}))))|((?:(?:(\\$)(\\{))([0-9]+)((?:(\\/)((?:(?:(?:(?:(\\\\)(\\\\\\/))|(?:(\\\\\\\\\\\\)(\\\\\\/)))|[^\\/\\n])+))(\\/)(((?:(?:(?:(?:(?:(?:(?:(?:\\$(?:(?)*?))(\\|)(\\}))))|((?:(?:(\\$)(\\{))([0-9]+)(:)(?:(?:(?:(?:(?:\\$(?:[0-9]+))|(?:(?:\\$\\{)(?:[0-9]+)\\}))|(?:(?:\\$\\{)(?:[0-9]+)(?:\\/((?:(?:(?:(?:\\\\(?:\\\\\\/))|(?:(?:\\\\\\\\\\\\)(?:\\\\\\/)))|[^\\/\\n])+))\\/((?:(?:(?:(?:(?:(?:(?:(?:(?:\\$(?:(?)+)(\\}))))|(?:(?:(?:((?:(\\$)((?+))(\\}))))|((?:(?:(\\$)(\\{))((?)*?))(\\|)(\\}))))|((?:(?:(\\$)(\\{))([0-9]+)(:)(?:(?:(?:(?:(?:\\$(?:[0-9]+))|(?:(?:\\$\\{)(?:[0-9]+)\\}))|(?:(?:\\$\\{)(?:[0-9]+)(?:\\/((?:(?:(?:(?:\\\\(?:\\\\\\/))|(?:(?:\\\\\\\\\\\\)(?:\\\\\\/)))|[^\\/\\n])+))\\/((?:(?:(?:(?:(?:(?:(?:(?:(?:\\$(?:(?)+)(\\}))))|(?:(?:(?:((?:(\\$)((?+))(\\}))))|((?:(?:(\\$)(\\{))((?][ \\t]*", "name": "keyword.operator.lua" }, { - "match": "([a-zA-Z_][a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]*)(?)", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#transition" + } + ] + }, + "2": { + "name": "punctuation.definition.tag.begin.html" + }, + "3": { + "name": "constant.character.escape.razor.tagHelperOptOut" + }, + "4": { + "name": "entity.name.tag.html" + } + }, + "patterns": [ + { + "include": "#razor-control-structures" + }, + { + "include": "text.html.derivative" + } + ], + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + } + }, + "inline-template-non-void-tag": { + "begin": "(@)(<)(!)?([^/\\s>]+)(?=\\s|/?>)", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#transition" + } + ] + }, + "2": { + "name": "punctuation.definition.tag.begin.html" + }, + "3": { + "name": "constant.character.escape.razor.tagHelperOptOut" + }, + "4": { + "name": "entity.name.tag.html" + } + }, + "end": "()|(/>)", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "punctuation.definition.tag.end.html" + }, + "4": { + "name": "punctuation.definition.tag.end.html" + } + }, + "patterns": [ + { + "begin": "(?<=>)(?!$)", + "end": "(?=