[textmate] update textmate grammars

GitOrigin-RevId: 0e5ac830d27df6ae00e735955e41436f00730fe3
This commit is contained in:
Alexander Zolotov
2024-07-04 17:40:44 +02:00
committed by intellij-monorepo-bot
parent 51bba9d7b3
commit 5604e99c11
14 changed files with 1016 additions and 134 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "asciidoctor-vscode",
"version": "3.2.4-dev",
"version": "3.3.2-dev",
"description": "%description%",
"license": "MIT",
"contributes": {

View File

@@ -21,9 +21,13 @@
"id": "cpp",
"extensions": [
".cpp",
".cppm",
".cc",
".ccm",
".cxx",
".cxxm",
".c++",
".c++m",
".hpp",
".hh",
".hxx",

View File

@@ -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"
}

View File

@@ -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": {

View File

@@ -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*)+)?(?<!\\,\\s*)(?:[\\w\\.\\*]+)\\s*)(?=\\`))",
"beginCaptures": {
"1": {
"patterns": [
{
"include": "#type-declarations"
},
{
"match": "\\w+",
"name": "entity.name.type.go"
}
]
}
},
"end": "(?=\\`)",
"patterns": [
{
"include": "#raw_string_literals"
}
]
},
{
"include": "#parameter-variable-types"
}
@@ -2192,7 +2215,7 @@
]
}
},
"end": "(?:(?<=\\])((?:\\s+)(?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?!(?:[\\[\\]\\*]+)?(?:\\bstruct\\b|\\binterface\\b|\\bfunc\\b))[\\w\\.\\-\\*\\[\\]]+))?)",
"end": "(?:(?<=\\])((?:\\s+)(?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?!(?:[\\[\\]\\*]+)?(?:\\bstruct\\b|\\binterface\\b|\\bfunc\\b))[\\w\\.\\-\\*\\[\\]]+(?:\\,\\s+[\\w\\.\\[\\]\\*]+)*))?)",
"endCaptures": {
"1": {
"patterns": [
@@ -2271,6 +2294,9 @@
{
"include": "#struct_variables_types"
},
{
"include": "#interface_variables_types"
},
{
"include": "#type-declarations-without-brackets"
},
@@ -2439,7 +2465,7 @@
},
"switch_types": {
"comment": "switch type assertions, only highlights types after case keyword",
"begin": "(?<=\\bswitch\\b)(?:\\s*)(?:(\\w+\\s*\\:\\=)?\\s*([\\w\\.\\*\\(\\)\\[\\]]+))(\\.\\(\\btype\\b\\)\\s*)(\\{)",
"begin": "(?<=\\bswitch\\b)(?:\\s*)(?:(\\w+\\s*\\:\\=)?\\s*([\\w\\.\\*\\(\\)\\[\\]\\+/\\-\\%\\<\\>\\|\\&]+))(\\.\\(\\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"

View File

@@ -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"
}
}

View File

@@ -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"

View File

@@ -79,6 +79,10 @@
[
"<",
">"
],
[
"~",
"~"
]
],
"folding": {

View File

@@ -1,6 +1,6 @@
{
"name": "vscode-mdx",
"version": "1.8.7",
"version": "1.8.9",
"description": "Language support for MDX",
"license": "MIT",
"contributes": {

View File

@@ -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"

View File

@@ -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": [

View File

@@ -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": "(?<![%$])([%$]{)",
"end": "\\}",
"comment": "String interpolation",
"beginCaptures": {
"1": {
"name": "keyword.other.interpolation.begin.hcl"
}
},
"endCaptures": {
"0": {
"name": "keyword.other.interpolation.end.hcl"
}
},
"patterns": [
{
"name": "keyword.operator.template.left.trim.hcl",
"match": "\\~\\s",
"comment": "Trim left whitespace"
},
{
"name": "keyword.operator.template.right.trim.hcl",
"match": "\\s\\~",
"comment": "Trim right whitespace"
},
{
"name": "keyword.control.hcl",
"match": "\\b(if|else|endif|for|in|endfor)\\b",
"comment": "if/else/endif and for/in/endfor directives"
},
{
"include": "#expressions"
},
{
"include": "#local_identifiers"
}
]
},
"string_literals": {
"name": "string.quoted.double.hcl",
"begin": "\"",
"end": "\"",
"comment": "Strings",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.hcl"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.hcl"
}
},
"patterns": [
{
"include": "#string_interpolation"
},
{
"include": "#char_escapes"
}
]
},
"tuple_for_expression": {
"begin": "(\\[)\\s?(for)\\b",
"end": "\\]",
"beginCaptures": {
"1": {
"name": "punctuation.section.brackets.begin.hcl"
},
"2": {
"name": "keyword.control.hcl"
}
},
"endCaptures": {
"0": {
"name": "punctuation.section.brackets.end.hcl"
}
},
"patterns": [
{
"include": "#for_expression_body"
}
]
}
}
}

View File

@@ -163,7 +163,7 @@
"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",
"}"
],
@@ -172,7 +172,7 @@
"For-Await-Of Loop": {
"prefix": "forawaitof",
"body": [
"for await (const ${1:iterator} of ${2:object}) {",
"for await (const ${1:element} of ${2:object}) {",
"\t$TM_SELECTED_TEXT$0",
"}"
],
@@ -266,6 +266,15 @@
],
"description": "Set Timeout Function"
},
"Set Interval Function": {
"prefix": "setinterval",
"body": [
"setInterval(() => {",
"\t$TM_SELECTED_TEXT$0",
"}, ${1:interval});"
],
"description": "Set Interval Function"
},
"Region Start": {
"prefix": "#region",
"body": [

View File

@@ -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"