diff --git a/extensions/csharp/cgmanifest.json b/extensions/csharp/cgmanifest.json index 0dceaebc966..1c88bd17296 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": "7bf5709ac1a713e340a618d1b41f44a043e393c6" + "commitHash": "7a7482ffc72a6677a87eb1ed76005593a4f7f131" } }, "license": "MIT", diff --git a/extensions/csharp/syntaxes/csharp.tmLanguage.json b/extensions/csharp/syntaxes/csharp.tmLanguage.json index 4e6a722d413..96dbe04473c 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/7bf5709ac1a713e340a618d1b41f44a043e393c6", + "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" }, @@ -1050,6 +1056,18 @@ "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": { @@ -2632,7 +2650,7 @@ }, "patterns": [ { - "begin": "\\G", + "begin": "(?=[^;\\)])", "end": "(?=;|\\))", "patterns": [ { @@ -2695,22 +2713,25 @@ "include": "#intrusive" }, { - "match": "(?x)\n(?:\n (\\bvar\\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)\\s+\n\\b(in)\\b", + "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": "storage.type.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" } } diff --git a/extensions/fsharp/cgmanifest.json b/extensions/fsharp/cgmanifest.json index 03dad6e72c9..524b3fa0d46 100644 --- a/extensions/fsharp/cgmanifest.json +++ b/extensions/fsharp/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "ionide/ionide-fsgrammar", "repositoryUrl": "https://github.com/ionide/ionide-fsgrammar", - "commitHash": "472c6b2030c962217cbbb26e4ddcce1b8ffe0867" + "commitHash": "7d029a46f17637228b2ee85dd02e511c3e8039b3" } }, "license": "MIT", diff --git a/extensions/fsharp/syntaxes/fsharp.tmLanguage.json b/extensions/fsharp/syntaxes/fsharp.tmLanguage.json index 20151138ccf..5063f1c5210 100644 --- a/extensions/fsharp/syntaxes/fsharp.tmLanguage.json +++ b/extensions/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/472c6b2030c962217cbbb26e4ddcce1b8ffe0867", + "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" } diff --git a/extensions/go/cgmanifest.json b/extensions/go/cgmanifest.json index 90df81c75ec..dd832ef5145 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": "4014e9376f32e5317eb0c6be286db7ffcba838f9" + "commitHash": "80a9e153c018b6c3b9c52766b39d7be9d915f68b" } }, "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.5.1" + "version": "0.5.5" } ], "version": 1 diff --git a/extensions/go/syntaxes/go.tmLanguage.json b/extensions/go/syntaxes/go.tmLanguage.json index 85e2bbfe78e..5917568d4cc 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/4014e9376f32e5317eb0c6be286db7ffcba838f9", + "version": "https://github.com/worlpaker/go-syntax/commit/80a9e153c018b6c3b9c52766b39d7be9d915f68b", "name": "Go", "scopeName": "source.go", "patterns": [ @@ -61,6 +61,9 @@ { "include": "#other_struct_interface_expressions" }, + { + "include": "#type_assertion_inline" + }, { "include": "#struct_variables_types" }, @@ -91,19 +94,22 @@ "comment": "all statements related to variables", "patterns": [ { - "include": "#after_control_variables" + "include": "#var_const_assignment" }, { - "include": "#var_const_single_assignment" + "include": "#variable_assignment" }, { - "include": "#var_assignment" + "include": "#label_loop_variables" }, { - "include": "#var_other_assignment" + "include": "#slice_index_variables" }, { - "include": "#var_const_multi_assignment" + "include": "#property_variables" + }, + { + "include": "#switch_select_case_variables" }, { "include": "#other_variables" @@ -141,7 +147,7 @@ "include": "#storage_types" }, { - "include": "#raw_strings_literals" + "include": "#raw_string_literals" }, { "include": "#string_literals" @@ -182,7 +188,7 @@ "include": "#storage_types" }, { - "include": "#raw_strings_literals" + "include": "#raw_string_literals" }, { "include": "#string_literals" @@ -582,7 +588,7 @@ } ] }, - "raw_strings_literals": { + "raw_string_literals": { "comment": "Raw string literals", "begin": "`", "beginCaptures": { @@ -1272,7 +1278,7 @@ }, { "comment": "struct type declaration", - "match": "((?:(?:\\w+\\,\\s*)+)?\\w+)\\s+(?=(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\[\\]\\*]+)?\\bstruct\\b\\s*\\{)", + "match": "((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)\\s+(?=(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\[\\]\\*]+)?\\bstruct\\b\\s*\\{)", "captures": { "1": { "patterns": [ @@ -1289,7 +1295,7 @@ }, { "comment": "multiple parameters one type -with multilines", - "match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)", + "match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\b\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)", "captures": { "1": { "patterns": [ @@ -1306,7 +1312,7 @@ }, { "comment": "multiple params and types | multiple params one type | one param one type", - "match": "(?:((?:(?:\\w+\\,\\s*)+)?\\w+)(?:\\s+)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?:(?:[\\w\\[\\]\\.\\*]+)?(?:(?:\\bfunc\\b\\((?:[^\\)]+)?\\))(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*))+(?:(?:(?:[\\w\\*\\.\\[\\]]+)|(?:\\((?:[^\\)]+)?\\))))?)|(?:(?:[\\[\\]\\*]+)?[\\w\\*\\.]+(?:\\[(?:[^\\]]+)\\])?(?:[\\w\\.\\*]+)?)+)))", + "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": [ @@ -1368,7 +1374,7 @@ }, { "comment": "multiple parameters one type -with multilines", - "match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)", + "match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\b\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)", "captures": { "1": { "patterns": [ @@ -1385,7 +1391,7 @@ }, { "comment": "multiple params and types | multiple types one param", - "match": "(?:((?:(?:\\w+\\,\\s*)+)?\\w+)(?:\\s+)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?:(?:[\\w\\[\\]\\.\\*]+)?(?:(?:\\bfunc\\b\\((?:[^\\)]+)?\\))(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*))+(?:(?:(?:[\\w\\*\\.]+)|(?:\\((?:[^\\)]+)?\\))))?)|(?:(?:(?:[\\w\\*\\.\\~]+)|(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\]))(?:[\\w\\.\\*]+)?)+)))", + "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": [ @@ -1430,7 +1436,7 @@ }, { "comment": "other types", - "match": "([\\w\\.]+)", + "match": "(?:\\b([\\w\\.]+))", "captures": { "1": { "patterns": [ @@ -1590,25 +1596,13 @@ } }, "other_struct_interface_expressions": { + "comment": "struct and interface expression in-line (before curly bracket)", "patterns": [ - { - "include": "#storage_types" - }, - { - "include": "#label_loop_variable" - }, - { - "include": "#property_variables" - }, - { - "include": "#switch_select_case_variables" - }, { "include": "#after_control_variables" }, { - "comment": "struct expression before curly bracket", - "match": "((?:(?:\\w+\\.)+)?\\w+)(\\[(?:[^\\]]+)?\\])?(?=\\{)(?|\\<\\=|\\>\\=|\\=\\=|\\!\\=|\\w(?:\\+|/|\\-|\\*|\\%)(?:\\=)?|\\|\\||\\&\\&)(?:\\s*)([[:alnum:]\\-\\_\\!\\.\\[\\]\\<\\>\\=\\*/\\+\\%\\:]+)(?:\\s*)(?=\\{))", + "match": "(?:(?<=\\brange\\b|\\bswitch\\b|\\;|\\bif\\b|\\bfor\\b|\\<|\\>|\\<\\=|\\>\\=|\\=\\=|\\!\\=|\\w(?:\\+|/|\\-|\\*|\\%)|\\w(?:\\+|/|\\-|\\*|\\%)\\=|\\|\\||\\&\\&)(?:\\s*)([[:alnum:]\\-\\_\\!\\.\\[\\]\\<\\>\\=\\*/\\+\\%\\:]+)(?:\\s*)(?=\\{))", "captures": { "1": { "patterns": [ @@ -2385,90 +2379,40 @@ } ] }, - "var_const_single_assignment": { - "comment": "var and const with single type assignment", - "match": "(?:(?<=\\bvar\\b|\\bconst\\b)(?:\\s*)([\\w\\.]+(?:(?:\\,\\s*[\\w\\.]+)+)?)(?:\\s*)(?:(?!(?:(?:[\\[\\]\\*]+)?\\bstruct\\b\\s*\\{)|(?:(?:[\\[\\]\\*]+)?\\bfunc\\b))((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?:(?:[\\w\\.\\*]+)?(?:\\[(?:.*)\\])?(?:[\\w\\.\\*]+)?))?\\s*(?:\\=)?))?)", - "captures": { - "1": { - "patterns": [ - { - "include": "#delimiters" - }, - { - "match": "(?:\\w+)", - "name": "variable.other.assignment.go" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#type-declarations" - }, - { - "include": "#generic_types" - }, - { - "match": "(?:\\w+)", - "name": "entity.name.type.go" - } - ] - } - } - }, - "var_assignment": { - "comment": "variable assignment", - "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" - } - ] - } - } - }, - "var_other_assignment": { - "comment": "variable other assignment", - "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" - } - ] - } - } - }, - "var_const_multi_assignment": { + "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*)([\\w\\.]+(?:(?:\\,\\s*[\\w\\.]+)+)?)(?:\\s*)(?:((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:(?:[\\[\\]\\*]+)?\\bstruct\\b\\s*\\{)|(?:(?:[\\[\\]\\*]+)?\\bfunc\\b))(?:(?:(?:[\\w\\.\\*]+)?(?:\\[(?:.*)\\])?(?:[\\w\\.\\*]+)?))?\\s*(?:\\=)?))?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "(?:\\w+)", + "name": "variable.other.assignment.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "include": "#generic_types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + } + }, { "comment": "var and const with multi type assignment", "begin": "(?:(?<=\\bvar\\b|\\bconst\\b)(?:\\s*)(\\())", @@ -2485,7 +2429,7 @@ }, "patterns": [ { - "match": "(?:(?:^\\s+)([\\w\\.]+(?:(?:\\,\\s*[\\w\\.]+)+)?)(?:\\s*)((?:(?!(?:(?:[\\[\\]\\*]+)?\\bstruct\\b\\s*\\{)|(?:(?:[\\[\\]\\*]+)?\\bfunc\\b))((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?:(?:[\\w\\.\\*]+)?(?:\\[(?:.*)\\])?(?:[\\w\\.\\*]+)?))?\\s*(?:\\=)?))?))", + "match": "(?:(?:^\\s+)([\\w\\.]+(?:(?:\\,\\s*[\\w\\.]+)+)?)(?:\\s*)((?:((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:(?:[\\[\\]\\*]+)?\\bstruct\\b\\s*\\{)|(?:(?:[\\[\\]\\*]+)?\\bfunc\\b))(?:(?:(?:[\\w\\.\\*]+)?(?:\\[(?:.*)\\])?(?:[\\w\\.\\*]+)?))?\\s*(?:\\=)?))?))", "captures": { "1": { "patterns": [ @@ -2521,6 +2465,56 @@ } ] }, + "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\\.\\*]+)(\\[(?:[^\\]]+)?\\]))", @@ -2568,52 +2562,103 @@ } } }, - "property_variables": { - "patterns": [ - { - "comment": "Property variables in struct", - "match": "(?:((?:[\\w\\.]+)(?:\\:))(?!\\=))", - "captures": { - "1": { - "patterns": [ - { - "include": "#type-declarations" - }, - { - "match": "\\w+", - "name": "variable.other.property.go" - } - ] - } - } - }, - { - "comment": "property variables as parameter field in struct initialization", - "match": "(?<=[\\w\\.]\\:)(?:\\s*)([\\w\\.\\*\\&\\[\\]]+)(\\.\\w+)(?![\\w\\.\\*\\&\\[\\]]*(?:\\{|\\())", - "captures": { - "1": { - "patterns": [ - { - "include": "$self" - } - ] + "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" }, - "2": { - "patterns": [ - { - "include": "#type-declarations" - }, - { - "match": "(?:\\w+)", - "name": "variable.other.property.field.go" - } - ] + { + "match": "\\w+", + "name": "variable.other.go" } - } + ] } - ] + } }, - "label_loop_variable": { + "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": { @@ -2632,24 +2677,34 @@ }, "double_parentheses_types": { "comment": "double parentheses types", - "match": "(?:(?:(\\()([^\\)]+)(\\)))(?=\\((?:[\\w\\.\\*\\&]+)\\)))", + "match": "(?:(\\((?:[\\w\\.\\[\\]\\*\\&]+)\\))(?=\\())", "captures": { "1": { - "name": "punctuation.definition.begin.bracket.round.go" - }, - "2": { "patterns": [ { - "include": "#type-declarations" + "include": "#type-declarations-without-brackets" + }, + { + "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" } ] - }, - "3": { - "name": "punctuation.definition.end.bracket.round.go" } } }, diff --git a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json index 4fe09e087aa..bec7b9f5b92 100644 --- a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScript.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": "JavaScript (with React support)", "scopeName": "source.js", "patterns": [ @@ -2351,12 +2351,15 @@ ] }, "import-export-assert-clause": { - "begin": "(?