diff --git a/plugins/textmate/lib/bundles/adoc/package.json b/plugins/textmate/lib/bundles/adoc/package.json index 8c3e79b0a829..52101bb05bbd 100644 --- a/plugins/textmate/lib/bundles/adoc/package.json +++ b/plugins/textmate/lib/bundles/adoc/package.json @@ -1,6 +1,6 @@ { "name": "asciidoctor-vscode", - "version": "3.2.4-dev", + "version": "3.3.2-dev", "description": "%description%", "license": "MIT", "contributes": { diff --git a/plugins/textmate/lib/bundles/cpp/package.json b/plugins/textmate/lib/bundles/cpp/package.json index 2c2237eb4b42..0d4281e82406 100644 --- a/plugins/textmate/lib/bundles/cpp/package.json +++ b/plugins/textmate/lib/bundles/cpp/package.json @@ -21,9 +21,13 @@ "id": "cpp", "extensions": [ ".cpp", + ".cppm", ".cc", + ".ccm", ".cxx", + ".cxxm", ".c++", + ".c++m", ".hpp", ".hh", ".hxx", diff --git a/plugins/textmate/lib/bundles/csharp/syntaxes/csharp.tmLanguage.json b/plugins/textmate/lib/bundles/csharp/syntaxes/csharp.tmLanguage.json index 96dbe04473c3..4a2497a064ab 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/7a7482ffc72a6677a87eb1ed76005593a4f7f131", + "version": "https://github.com/dotnet/csharp-tmLanguage/commit/d63e2661d4e0c83b6c7810eb1d0eedc5da843b04", "name": "C#", "scopeName": "source.cs", "patterns": [ @@ -512,6 +512,9 @@ { "include": "#type-name" }, + { + "include": "#type-arguments" + }, { "include": "#attribute-arguments" } diff --git a/plugins/textmate/lib/bundles/fsharp/syntaxes/fsharp.tmLanguage.json b/plugins/textmate/lib/bundles/fsharp/syntaxes/fsharp.tmLanguage.json index 5063f1c5210c..7806c100eae9 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/7d029a46f17637228b2ee85dd02e511c3e8039b3", + "version": "https://github.com/ionide/ionide-fsgrammar/commit/0100f551f6c32598a58aba97344bf828673fec7a", "name": "fsharp", "scopeName": "source.fsharp", "patterns": [ @@ -617,7 +617,7 @@ }, { "name": "constant.numeric.float.fsharp", - "match": "\\b-?[0-9][0-9_]*((\\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))" + "match": "\\b-?[0-9][0-9_]*((\\.(?!\\.)([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))" }, { "name": "constant.numeric.integer.nativeint.fsharp", @@ -635,7 +635,7 @@ }, "abstract_definition": { "name": "abstract.definition.fsharp", - "begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(<)?", + "begin": "\\b(static)?\\s+(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(<)?", "end": "\\s*(with)\\b|=|$", "beginCaptures": { "1": { @@ -645,6 +645,9 @@ "name": "keyword.fsharp" }, "3": { + "name": "keyword.fsharp" + }, + "4": { "name": "support.function.attribute.fsharp" }, "5": { @@ -933,7 +936,7 @@ "patterns": [ { "name": "binding.fsharp", - "begin": "\\b(let mutable|static let mutable|static let|let inline|let|and|member val|static member inline|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?", + "begin": "\\b(let mutable|static let mutable|static let|let inline|let|and|member val|member inline|static member inline|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?", "end": "\\s*((with\\b)|(=|\\n+=|(?<=\\=)))", "beginCaptures": { "1": { @@ -1008,7 +1011,7 @@ }, { "name": "binding.fsharp", - "begin": "\\b(static val mutable|val mutable|val)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?", + "begin": "\\b(static val mutable|val mutable|val inline|val)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?", "end": "\\n$", "beginCaptures": { "1": { diff --git a/plugins/textmate/lib/bundles/go/syntaxes/go.tmLanguage.json b/plugins/textmate/lib/bundles/go/syntaxes/go.tmLanguage.json index 21b370514d0a..b8a6604de88b 100644 --- a/plugins/textmate/lib/bundles/go/syntaxes/go.tmLanguage.json +++ b/plugins/textmate/lib/bundles/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/092c45ec9a51fe40188408d1371f123eaa4796fa", + "version": "https://github.com/worlpaker/go-syntax/commit/21f28840e04d4fa04682d19d6fe64de437f40b64", "name": "Go", "scopeName": "source.go", "patterns": [ @@ -321,7 +321,7 @@ "name": "punctuation.definition.begin.bracket.square.go" } }, - "end": "(?:(\\])((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?\\b(?:func|struct|map)\\b)(?:[\\*\\[\\]]+)?(?:[\\w\\.]+))?)", + "end": "(?:(\\])((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?\\b(?:func|struct|map)\\b)(?:[\\*\\[\\]]+)?(?:[\\w\\.]+)(?:\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}]+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?)?)", "endCaptures": { "1": { "name": "punctuation.definition.end.bracket.square.go" @@ -1862,7 +1862,7 @@ }, { "comment": "property variables and types", - "match": "(?:((?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))([\\s\\S]+))", + "match": "(?:((?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))([^\\`]+))", "captures": { "1": { "patterns": [ @@ -2007,6 +2007,29 @@ } ] }, + { + "comment": "one type only with multi line raw string", + "begin": "(?:((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?\\|\\&]+))(\\.\\(\\btype\\b\\)\\s*)(\\{)", "beginCaptures": { "1": { "patterns": [ @@ -2770,7 +2796,7 @@ }, "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\\.\\*\\+/\\-\\*\\%\\<\\>\\|\\&]+)?)(?=\\])", + "match": "(?<=\\w\\[)((?:(?:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+\\:)|(?:\\:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+))(?:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+)?(?:\\:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+)?)(?=\\])", "captures": { "1": { "patterns": [ @@ -2786,8 +2812,8 @@ } }, "property_variables": { - "comment": "Property variables in struct | parameter field in struct initialization", - "match": "(?:(?:((?:\\b[\\w\\.]+)(?:\\:(?!\\=))))(?:(?:\\s*([\\w\\.\\*\\&\\[\\]]+)(\\.\\w+)(?![\\w\\.\\*\\&\\[\\]]*(?:\\{|\\()))((?:\\s*(?:\\<|\\>|\\<\\=|\\>\\=|\\=\\=|\\!\\=|\\|\\||\\&\\&|\\+|/|\\-|\\*|\\%|\\||\\&)\\s*(?:[\\w\\.\\*\\&\\[\\]]+)(?:\\.\\w+)(?![\\w\\.\\*\\&\\[\\]]*(?:\\{|\\()))*))?)", + "comment": "Property variables in struct", + "match": "((?:\\b[\\w\\.]+)(?:\\:(?!\\=)))", "captures": { "1": { "patterns": [ @@ -2799,68 +2825,6 @@ "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" - } - ] } } }, @@ -2931,13 +2895,16 @@ }, "2": { "patterns": [ - { - "include": "#type-declarations" - }, { "match": "\\binvalid\\b\\s+\\btype\\b", "name": "invalid.field.go" }, + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, { "match": "\\w+", "name": "entity.name.type.go" diff --git a/plugins/textmate/lib/bundles/javascript/snippets/javascript.code-snippets b/plugins/textmate/lib/bundles/javascript/snippets/javascript.code-snippets index 9448fd140d93..5bf6aa5edeea 100644 --- a/plugins/textmate/lib/bundles/javascript/snippets/javascript.code-snippets +++ b/plugins/textmate/lib/bundles/javascript/snippets/javascript.code-snippets @@ -1,16 +1,79 @@ { - "define module": { - "prefix": "define", + "Constructor": { + "prefix": "ctor", "body": [ - "define([", - "\t'require',", - "\t'${1:dependency}'", - "], function(require, ${2:factory}) {", - "\t'use strict';", + "/**", + " *", + " */", + "constructor() {", + "\tsuper();", "\t$0", - "});" + "}" ], - "description": "define module" + "description": "Constructor" + }, + "Class Definition": { + "prefix": "class", + "isFileTemplate": true, + "body": [ + "class ${1:name} {", + "\tconstructor(${2:parameters}) {", + "\t\t$0", + "\t}", + "}" + ], + "description": "Class Definition" + }, + "Method Definition": { + "prefix": "method", + "body": [ + "/**", + " * ", + " */", + "${1:name}() {", + "\t$0", + "}" + ], + "description": "Method Definition" + }, + "Import Statement": { + "prefix": "import", + "body": [ + "import { $0 } from \"${1:module}\";" + ], + "description": "Import external module" + }, + "Log to the console": { + "prefix": "log", + "body": [ + "console.log($1);", + "$0" + ], + "description": "Log to the console" + }, + "Log warning to console": { + "prefix": "warn", + "body": [ + "console.warn($1);", + "$0" + ], + "description": "Log warning to the console" + }, + "Log error to console": { + "prefix": "error", + "body": [ + "console.error($1);", + "$0" + ], + "description": "Log error to the console" + }, + "Throw Exception": { + "prefix": "throw", + "body": [ + "throw new Error(\"$1\");", + "$0" + ], + "description": "Throw Exception" }, "For Loop": { "prefix": "for", @@ -22,20 +85,20 @@ ], "description": "For Loop" }, - "For-Each Loop": { - "prefix": "foreach", + "For-Each Loop using =>": { + "prefix": "foreach =>", "body": [ "${1:array}.forEach(${2:element} => {", "\t$TM_SELECTED_TEXT$0", "});" ], - "description": "For-Each Loop" + "description": "For-Each Loop using =>" }, "For-In Loop": { "prefix": "forin", "body": [ "for (const ${1:key} in ${2:object}) {", - "\tif (Object.hasOwnProperty.call(${2:object}, ${1:key})) {", + "\tif (Object.prototype.hasOwnProperty.call(${2:object}, ${1:key})) {", "\t\tconst ${3:element} = ${2:object}[${1:key}];", "\t\t$TM_SELECTED_TEXT$0", "\t}", @@ -46,12 +109,21 @@ "For-Of Loop": { "prefix": "forof", "body": [ - "for (const ${1:iterator} of ${2:object}) {", + "for (const ${1:element} of ${2:object}) {", "\t$TM_SELECTED_TEXT$0", "}" ], "description": "For-Of Loop" }, + "For-Await-Of Loop": { + "prefix": "forawaitof", + "body": [ + "for await (const ${1:element} of ${2:object}) {", + "\t$TM_SELECTED_TEXT$0", + "}" + ], + "description": "For-Await-Of Loop" + }, "Function Statement": { "prefix": "function", "body": [ @@ -149,13 +221,6 @@ ], "description": "Set Interval Function" }, - "Import Statement": { - "prefix": "import", - "body": [ - "import { $0 } from \"${1:module}\";" - ], - "description": "Import external module" - }, "Region Start": { "prefix": "#region", "body": [ @@ -170,27 +235,6 @@ ], "description": "Folding Region End" }, - "Log to the console": { - "prefix": "log", - "body": [ - "console.log($1);" - ], - "description": "Log to the console" - }, - "Log warning to console": { - "prefix": "warn", - "body": [ - "console.warn($1);" - ], - "description": "Log warning to the console" - }, - "Log error to console": { - "prefix": "error", - "body": [ - "console.error($1);" - ], - "description": "Log error to the console" - }, "new Promise": { "prefix": "newpromise", "body": [ @@ -199,5 +243,23 @@ "})" ], "description": "Create a new Promise" + }, + "Async Function Statement": { + "prefix": "async function", + "body": [ + "async function ${1:name}(${2:params}) {", + "\t$TM_SELECTED_TEXT$0", + "}" + ], + "description": "Async Function Statement" + }, + "Async Function Expression": { + "prefix": "async arrow function", + "body": [ + "async (${1:params}) => {", + "\t$TM_SELECTED_TEXT$0", + "}" + ], + "description": "Async Function Expression" } } diff --git a/plugins/textmate/lib/bundles/latex/syntaxes/LaTeX.tmLanguage.json b/plugins/textmate/lib/bundles/latex/syntaxes/LaTeX.tmLanguage.json index aad6c5c4bd9f..764867321953 100644 --- a/plugins/textmate/lib/bundles/latex/syntaxes/LaTeX.tmLanguage.json +++ b/plugins/textmate/lib/bundles/latex/syntaxes/LaTeX.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/jlelong/vscode-latex-basics/commit/3d141a124a16558958e95c54267f7ca37986de6f", + "version": "https://github.com/jlelong/vscode-latex-basics/commit/9cd6bc151f4b9df5d9aeb1e39e30071018d3cb2a", "name": "LaTeX", "scopeName": "text.tex.latex", "patterns": [ @@ -2646,7 +2646,7 @@ ] }, { - "begin": "((\\\\)(?:\\w*[rR]ef\\*?))(\\{)", + "begin": "((\\\\)(?:\\w*[rR]ef\\*?))(?:\\[[^\\]]*\\])?(\\{)", "beginCaptures": { "1": { "name": "keyword.control.ref.latex" @@ -3048,7 +3048,7 @@ "name": "punctuation.definition.variable.latex" } }, - "match": "(\\\\)[cgl](?:[_\\p{Alphabetic}@]+)+_(?:bitset|clist|dim|fp|int|muskip|str|tl|bool|box|coffin|flag|fparray|intarray|ior|iow|prop|regex|seq)", + "match": "(\\\\)[cgl](?:[_\\p{Alphabetic}@]+)+_[a-z]+", "name": "variable.other.latex3.latex" }, { @@ -3148,7 +3148,7 @@ "match": "\\s*((\\\\)(?:begin|end))(\\{)([a-zA-Z]*\\*?)(\\})(?:(\\[)([^\\]]*)(\\])){,2}(?:(\\{)([^{}]*)(\\}))?" }, "definition-label": { - "begin": "((\\\\)label)((?:\\[[^\\[]*?\\])*)(\\{)", + "begin": "((\\\\)z?label)((?:\\[[^\\[]*?\\])*)(\\{)", "beginCaptures": { "1": { "name": "keyword.control.label.latex" diff --git a/plugins/textmate/lib/bundles/markdown-basics/language-configuration.json b/plugins/textmate/lib/bundles/markdown-basics/language-configuration.json index f1e7859ccca5..6e1766db02cd 100644 --- a/plugins/textmate/lib/bundles/markdown-basics/language-configuration.json +++ b/plugins/textmate/lib/bundles/markdown-basics/language-configuration.json @@ -79,6 +79,10 @@ [ "<", ">" + ], + [ + "~", + "~" ] ], "folding": { diff --git a/plugins/textmate/lib/bundles/mdx/package.json b/plugins/textmate/lib/bundles/mdx/package.json index 557759419cec..17c3f0f8758e 100644 --- a/plugins/textmate/lib/bundles/mdx/package.json +++ b/plugins/textmate/lib/bundles/mdx/package.json @@ -1,6 +1,6 @@ { "name": "vscode-mdx", - "version": "1.8.7", + "version": "1.8.9", "description": "Language support for MDX", "license": "MIT", "contributes": { diff --git a/plugins/textmate/lib/bundles/swift/syntaxes/swift.tmLanguage.json b/plugins/textmate/lib/bundles/swift/syntaxes/swift.tmLanguage.json index 6259b151369f..b18b340f2c68 100644 --- a/plugins/textmate/lib/bundles/swift/syntaxes/swift.tmLanguage.json +++ b/plugins/textmate/lib/bundles/swift/syntaxes/swift.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/jtbandes/swift-tmlanguage/commit/ab893c684dd7eeb7c249139e29e931334316fda7", + "version": "https://github.com/jtbandes/swift-tmlanguage/commit/860eface4241cf9f2174d5fa690bd34389ac8d26", "name": "Swift", "scopeName": "source.swift", "comment": "See swift.tmbundle/grammar-test.swift for test cases.", @@ -52,7 +52,7 @@ }, "patterns": [ { - "match": "\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?", + "match": "\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?", "captures": { "1": { "name": "keyword.other.platform.os.swift" @@ -580,7 +580,7 @@ } }, { - "match": "\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))", + "match": "\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|visionOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))", "captures": { "1": { "name": "keyword.other.condition.swift" @@ -2586,7 +2586,7 @@ }, "patterns": [ { - "match": "\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))", + "match": "\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))", "captures": { "1": { "name": "keyword.other.platform.os.swift" diff --git a/plugins/textmate/lib/bundles/terraform/package.json b/plugins/textmate/lib/bundles/terraform/package.json index 2dfd01e6ccdb..a9b0bbcc40d0 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.30.1", + "version": "2.31.0", "description": "Syntax highlighting and autocompletion for Terraform", "license": "MPL-2.0", "contributes": { @@ -23,6 +23,34 @@ ], "configuration": "./language-configuration.json" }, + { + "id": "terraform-stack", + "aliases": [ + "Terraform Stack" + ], + "extensions": [ + ".tfstack.hcl" + ], + "configuration": "./language-configuration.json", + "icon": { + "dark": "assets/icons/terraform_stacks.svg", + "light": "assets/icons/terraform_stacks.svg" + } + }, + { + "id": "terraform-deploy", + "aliases": [ + "Terraform Deployment" + ], + "extensions": [ + ".tfdeploy.hcl" + ], + "configuration": "./language-configuration.json", + "icon": { + "dark": "assets/icons/terraform_stacks.svg", + "light": "assets/icons/terraform_stacks.svg" + } + }, { "id": "json", "extensions": [ @@ -40,6 +68,16 @@ "language": "terraform-vars", "scopeName": "source.hcl.terraform", "path": "./syntaxes/terraform.tmGrammar.json" + }, + { + "language": "terraform-stack", + "scopeName": "source.hcl", + "path": "./syntaxes/hcl.tmGrammar.json" + }, + { + "language": "terraform-deploy", + "scopeName": "source.hcl", + "path": "./syntaxes/hcl.tmGrammar.json" } ], "semanticTokenTypes": [ diff --git a/plugins/textmate/lib/bundles/terraform/syntaxes/hcl.tmGrammar.json b/plugins/textmate/lib/bundles/terraform/syntaxes/hcl.tmGrammar.json new file mode 100644 index 000000000000..d79e516aa2e4 --- /dev/null +++ b/plugins/textmate/lib/bundles/terraform/syntaxes/hcl.tmGrammar.json @@ -0,0 +1,791 @@ +{ + "scopeName": "source.hcl", + "name": "HashiCorp HCL", + "uuid": "a14187be-98d8-42c1-ac89-bb5eaccf911e", + "fileTypes": [ + "hcl" + ], + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#attribute_definition" + }, + { + "include": "#block" + }, + { + "include": "#expressions" + } + ], + "repository": { + "attribute_access": { + "begin": "\\.(?!\\*)", + "end": "[[:alpha:]][\\w-]*|\\d*", + "comment": "Matches traversal attribute access such as .attr", + "beginCaptures": { + "0": { + "name": "keyword.operator.accessor.hcl" + } + }, + "endCaptures": { + "0": { + "patterns": [ + { + "match": "(?!null|false|true)[[:alpha:]][\\w-]*", + "comment": "Attribute name", + "name": "variable.other.member.hcl" + }, + { + "match": "\\d+", + "comment": "Optional attribute index", + "name": "constant.numeric.integer.hcl" + } + ] + } + } + }, + "attribute_definition": { + "name": "variable.declaration.hcl", + "match": "(\\()?(\\b(?!null\\b|false\\b|true\\b)[[:alpha:]][[:alnum:]_-]*)(\\))?\\s*(\\=(?!\\=|\\>))\\s*", + "comment": "Identifier \"=\" with optional parens", + "captures": { + "1": { + "name": "punctuation.section.parens.begin.hcl" + }, + "2": { + "name": "variable.other.readwrite.hcl" + }, + "3": { + "name": "punctuation.section.parens.end.hcl" + }, + "4": { + "name": "keyword.operator.assignment.hcl" + } + } + }, + "attribute_splat": { + "begin": "\\.", + "end": "\\*", + "comment": "Legacy attribute-only splat", + "beginCaptures": { + "0": { + "name": "keyword.operator.accessor.hcl" + } + }, + "endCaptures": { + "0": { + "name": "keyword.operator.splat.hcl" + } + } + }, + "block": { + "name": "meta.block.hcl", + "begin": "([\\w][\\-\\w]*)([^?\\r\\n]*)(\\{)", + "end": "\\}", + "comment": "This will match HCL blocks like `thing1 \"one\" \"two\" {` or `thing2 {`", + "beginCaptures": { + "1": { + "patterns": [ + { + "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b", + "comment": "Block type", + "name": "entity.name.type.hcl" + } + ] + }, + "2": { + "patterns": [ + { + "match": "\\\"[^\\\"\\r\\n]*\\\"", + "comment": "Block label (String Literal)", + "name": "variable.other.enummember.hcl" + }, + { + "match": "[[:alpha:]][[:alnum:]_-]*", + "comment": "Block label (Indentifier)", + "name": "variable.other.enummember.hcl" + } + ] + }, + "3": { + "name": "punctuation.section.block.begin.hcl" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.hcl" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#attribute_definition" + }, + { + "include": "#expressions" + }, + { + "include": "#block" + } + ] + }, + "block_inline_comments": { + "name": "comment.block.hcl", + "begin": "/\\*", + "end": "\\*/", + "comment": "Inline comments start with the /* sequence and end with the */ sequence, and may have any characters within except the ending sequence. An inline comment is considered equivalent to a whitespace sequence", + "captures": { + "0": { + "name": "punctuation.definition.comment.hcl" + } + } + }, + "brackets": { + "begin": "\\[", + "end": "\\]", + "beginCaptures": { + "0": { + "name": "punctuation.section.brackets.begin.hcl" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.brackets.end.hcl" + } + }, + "patterns": [ + { + "name": "keyword.operator.splat.hcl", + "match": "\\*", + "comment": "Splat operator" + }, + { + "include": "#comma" + }, + { + "include": "#comments" + }, + { + "include": "#inline_for_expression" + }, + { + "include": "#inline_if_expression" + }, + { + "include": "#expressions" + }, + { + "include": "#local_identifiers" + } + ] + }, + "char_escapes": { + "name": "constant.character.escape.hcl", + "match": "\\\\[nrt\"\\\\]|\\\\u(\\h{8}|\\h{4})", + "comment": "Character Escapes" + }, + "comma": { + "name": "punctuation.separator.hcl", + "match": "\\,", + "comment": "Commas - used in certain expressions" + }, + "comments": { + "patterns": [ + { + "include": "#hash_line_comments" + }, + { + "include": "#double_slash_line_comments" + }, + { + "include": "#block_inline_comments" + } + ] + }, + "double_slash_line_comments": { + "name": "comment.line.double-slash.hcl", + "begin": "//", + "end": "$\\n?", + "comment": "Line comments start with // sequence and end with the next newline sequence. A line comment is considered equivalent to a newline sequence", + "captures": { + "0": { + "name": "punctuation.definition.comment.hcl" + } + } + }, + "expressions": { + "patterns": [ + { + "include": "#literal_values" + }, + { + "include": "#operators" + }, + { + "include": "#tuple_for_expression" + }, + { + "include": "#object_for_expression" + }, + { + "include": "#brackets" + }, + { + "include": "#objects" + }, + { + "include": "#attribute_access" + }, + { + "include": "#attribute_splat" + }, + { + "include": "#functions" + }, + { + "include": "#parens" + } + ] + }, + "for_expression_body": { + "patterns": [ + { + "name": "keyword.operator.word.hcl", + "match": "\\bin\\b", + "comment": "in keyword" + }, + { + "name": "keyword.control.conditional.hcl", + "match": "\\bif\\b", + "comment": "if keyword" + }, + { + "name": "keyword.operator.hcl", + "match": "\\:" + }, + { + "include": "#expressions" + }, + { + "include": "#comments" + }, + { + "include": "#comma" + }, + { + "include": "#local_identifiers" + } + ] + }, + "functions": { + "name": "meta.function-call.hcl", + "begin": "([:\\-\\w]+)(\\()", + "end": "\\)", + "comment": "Built-in function calls", + "beginCaptures": { + "1": { + "patterns": [ + { + "match": "\\b[[:alpha:]][\\w_-]*::([[:alpha:]][\\w_-]*::)?[[:alpha:]][\\w_-]*\\b", + "name": "support.function.namespaced.hcl" + }, + { + "match": "\\b[[:alpha:]][\\w_-]*\\b", + "name": "support.function.builtin.hcl" + } + ] + }, + "2": { + "name": "punctuation.section.parens.begin.hcl" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.hcl" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#expressions" + }, + { + "include": "#comma" + } + ] + }, + "hash_line_comments": { + "name": "comment.line.number-sign.hcl", + "begin": "#", + "end": "$\\n?", + "comment": "Line comments start with # sequence and end with the next newline sequence. A line comment is considered equivalent to a newline sequence", + "captures": { + "0": { + "name": "punctuation.definition.comment.hcl" + } + } + }, + "hcl_type_keywords": { + "name": "storage.type.hcl", + "match": "\\b(any|string|number|bool|list|set|map|tuple|object)\\b", + "comment": "Type keywords known to HCL." + }, + "heredoc": { + "name": "string.unquoted.heredoc.hcl", + "begin": "(\\<\\<\\-?)\\s*(\\w+)\\s*$", + "end": "^\\s*\\2\\s*$", + "comment": "String Heredoc", + "beginCaptures": { + "1": { + "name": "keyword.operator.heredoc.hcl" + }, + "2": { + "name": "keyword.control.heredoc.hcl" + } + }, + "endCaptures": { + "0": { + "name": "keyword.control.heredoc.hcl" + } + }, + "patterns": [ + { + "include": "#string_interpolation" + } + ] + }, + "inline_for_expression": { + "match": "(for)\\b(.*)\\n", + "captures": { + "1": { + "name": "keyword.control.hcl" + }, + "2": { + "patterns": [ + { + "match": "\\=\\>", + "name": "storage.type.function.hcl" + }, + { + "include": "#for_expression_body" + } + ] + } + } + }, + "inline_if_expression": { + "begin": "(if)\\b", + "end": "\\n", + "beginCaptures": { + "1": { + "name": "keyword.control.conditional.hcl" + } + }, + "patterns": [ + { + "include": "#expressions" + }, + { + "include": "#comments" + }, + { + "include": "#comma" + }, + { + "include": "#local_identifiers" + } + ] + }, + "language_constants": { + "name": "constant.language.hcl", + "match": "\\b(true|false|null)\\b", + "comment": "Language Constants" + }, + "literal_values": { + "patterns": [ + { + "include": "#numeric_literals" + }, + { + "include": "#language_constants" + }, + { + "include": "#string_literals" + }, + { + "include": "#heredoc" + }, + { + "include": "#hcl_type_keywords" + } + ] + }, + "local_identifiers": { + "name": "variable.other.readwrite.hcl", + "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b", + "comment": "Local Identifiers" + }, + "numeric_literals": { + "patterns": [ + { + "name": "constant.numeric.float.hcl", + "match": "\\b\\d+([Ee][+-]?)\\d+\\b", + "comment": "Integer, no fraction, optional exponent", + "captures": { + "1": { + "name": "punctuation.separator.exponent.hcl" + } + } + }, + { + "name": "constant.numeric.float.hcl", + "match": "\\b\\d+(\\.)\\d+(?:([Ee][+-]?)\\d+)?\\b", + "comment": "Integer, fraction, optional exponent", + "captures": { + "1": { + "name": "punctuation.separator.decimal.hcl" + }, + "2": { + "name": "punctuation.separator.exponent.hcl" + } + } + }, + { + "name": "constant.numeric.integer.hcl", + "match": "\\b\\d+\\b", + "comment": "Integers" + } + ] + }, + "object_for_expression": { + "begin": "(\\{)\\s?(for)\\b", + "end": "\\}", + "beginCaptures": { + "1": { + "name": "punctuation.section.braces.begin.hcl" + }, + "2": { + "name": "keyword.control.hcl" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.braces.end.hcl" + } + }, + "patterns": [ + { + "name": "storage.type.function.hcl", + "match": "\\=\\>" + }, + { + "include": "#for_expression_body" + } + ] + }, + "object_key_values": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#literal_values" + }, + { + "include": "#operators" + }, + { + "include": "#tuple_for_expression" + }, + { + "include": "#object_for_expression" + }, + { + "include": "#heredoc" + }, + { + "include": "#functions" + } + ] + }, + "objects": { + "name": "meta.braces.hcl", + "begin": "\\{", + "end": "\\}", + "beginCaptures": { + "0": { + "name": "punctuation.section.braces.begin.hcl" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.braces.end.hcl" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#objects" + }, + { + "include": "#inline_for_expression" + }, + { + "include": "#inline_if_expression" + }, + { + "match": "\\b((?!null|false|true)[[:alpha:]][[:alnum:]_-]*)\\s*(\\=(?!=))\\s*", + "comment": "Literal, named object key", + "captures": { + "1": { + "name": "meta.mapping.key.hcl variable.other.readwrite.hcl" + }, + "2": { + "name": "keyword.operator.assignment.hcl" + } + } + }, + { + "match": "^\\s*((\").*(\"))\\s*(\\=)\\s*", + "comment": "String object key", + "captures": { + "1": { + "name": "meta.mapping.key.hcl string.quoted.double.hcl" + }, + "2": { + "name": "punctuation.definition.string.begin.hcl" + }, + "3": { + "name": "punctuation.definition.string.end.hcl" + }, + "4": { + "name": "keyword.operator.hcl" + } + } + }, + { + "name": "meta.mapping.key.hcl", + "begin": "^\\s*\\(", + "end": "(\\))\\s*(=|:)\\s*", + "comment": "Computed object key (any expression between parens)", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.hcl" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.section.parens.end.hcl" + }, + "2": { + "name": "keyword.operator.hcl" + } + }, + "patterns": [ + { + "include": "#attribute_access" + }, + { + "include": "#attribute_splat" + } + ] + }, + { + "include": "#object_key_values" + } + ] + }, + "operators": { + "patterns": [ + { + "name": "keyword.operator.hcl", + "match": "\\>\\=" + }, + { + "name": "keyword.operator.hcl", + "match": "\\<\\=" + }, + { + "name": "keyword.operator.hcl", + "match": "\\=\\=" + }, + { + "name": "keyword.operator.hcl", + "match": "\\!\\=" + }, + { + "name": "keyword.operator.arithmetic.hcl", + "match": "\\+" + }, + { + "name": "keyword.operator.arithmetic.hcl", + "match": "\\-" + }, + { + "name": "keyword.operator.arithmetic.hcl", + "match": "\\*" + }, + { + "name": "keyword.operator.arithmetic.hcl", + "match": "\\/" + }, + { + "name": "keyword.operator.arithmetic.hcl", + "match": "\\%" + }, + { + "name": "keyword.operator.logical.hcl", + "match": "\\&\\&" + }, + { + "name": "keyword.operator.logical.hcl", + "match": "\\|\\|" + }, + { + "name": "keyword.operator.logical.hcl", + "match": "\\!" + }, + { + "name": "keyword.operator.hcl", + "match": "\\>" + }, + { + "name": "keyword.operator.hcl", + "match": "\\<" + }, + { + "name": "keyword.operator.hcl", + "match": "\\?" + }, + { + "name": "keyword.operator.hcl", + "match": "\\.\\.\\." + }, + { + "name": "keyword.operator.hcl", + "match": "\\:" + }, + { + "name": "keyword.operator.hcl", + "match": "\\=\\>" + } + ] + }, + "parens": { + "begin": "\\(", + "end": "\\)", + "comment": "Parens - matched *after* function syntax", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.hcl" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.hcl" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#expressions" + } + ] + }, + "string_interpolation": { + "name": "meta.interpolation.hcl", + "begin": "(? {", + "\t$TM_SELECTED_TEXT$0", + "}, ${1:interval});" + ], + "description": "Set Interval Function" + }, "Region Start": { "prefix": "#region", "body": [ diff --git a/plugins/textmate/loadVSCBundles.sh b/plugins/textmate/loadVSCBundles.sh index d2e2e65dcf82..730605bff618 100755 --- a/plugins/textmate/loadVSCBundles.sh +++ b/plugins/textmate/loadVSCBundles.sh @@ -148,6 +148,7 @@ cd .. mkdir -p "$ROOT/lib/bundles/terraform/syntaxes" wget -q https://raw.githubusercontent.com/hashicorp/syntax/main/syntaxes/terraform.tmGrammar.json -O "$ROOT/lib/bundles/terraform/syntaxes/terraform.tmGrammar.json" +wget -q https://raw.githubusercontent.com/hashicorp/syntax/main/syntaxes/hcl.tmGrammar.json -O "$ROOT/lib/bundles/terraform/syntaxes/hcl.tmGrammar.json" mkdir -p "$ROOT/lib/bundles/hcl/syntaxes" wget -q https://raw.githubusercontent.com/hashicorp/syntax/main/syntaxes/hcl.tmGrammar.json -O "$ROOT/lib/bundles/hcl/syntaxes/hcl.tmGrammar.json"