shiki 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/langs/move.d.mts +1 -0
- package/dist/langs/move.mjs +6 -0
- package/dist/langs/razor.mjs +1 -1
- package/dist/langs/scala.mjs +1 -1
- package/dist/langs/terraform.d.mts +1 -0
- package/dist/langs/terraform.mjs +6 -0
- package/dist/langs/zig.mjs +1 -1
- package/dist/langs.d.mts +1 -1
- package/dist/langs.mjs +15 -1
- package/dist/themes/vesper.d.mts +1 -0
- package/dist/themes/vesper.mjs +637 -0
- package/dist/themes.d.mts +1 -1
- package/dist/themes.mjs +6 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LanguageRegistration } from '@shikijs/core';declare const reg: LanguageRegistration[];export default reg
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const lang = Object.freeze({ "displayName": "Move", "name": "move", "patterns": [{ "include": "#address" }, { "include": "#comments" }, { "include": "#module" }, { "include": "#script" }, { "include": "#macros" }], "repository": { "address": { "begin": "\\b(address)\\b", "beginCaptures": { "1": { "name": "storage.modifier.type.address.keyword.move" } }, "comment": "Address block", "end": "(?<=})", "name": "meta.address_block.move", "patterns": [{ "include": "#comments" }, { "begin": "(?<=address)", "comment": "Address value/const", "end": "(?=[{])", "name": "meta.address.definition.move", "patterns": [{ "include": "#comments" }, { "include": "#address_literal" }, { "comment": "Named Address", "match": "\\b(\\w+)\\b", "name": "entity.name.type.move" }] }, { "include": "#module" }] }, "address_literal": { "patterns": [{ "comment": "16-byte (or shorter) hex address in Libra", "match": "\\b(0x[A-Fa-f0-9][A-Fa-f0-9]{,31})\\b", "name": "support.constant.diem.address.move" }, { "comment": "Bech32 with wallet1 prefix - Dfinance format", "match": "\\b(wallet1\\w{38})", "name": "support.constant.dfinance.address.move" }, { "comment": "Named address parameter (as build flag)", "match": "\\s([@]\\w+)\\b", "name": "support.constant.named.address.move" }] }, "as": { "comment": "Keyword as", "match": "\\b(as)\\b", "name": "keyword.control.move" }, "as-import": { "comment": "Keyword as in import statement", "match": "\\b(as)\\b", "name": "meta.import_as.move" }, "assert": { "comment": "Assert built-in", "match": "\\b(assert)\\b", "name": "support.function.assert.move" }, "block": { "begin": "{", "comment": "Block expression or definition", "end": "}", "name": "meta.block.move", "patterns": [{ "include": "#comments" }, { "include": "#as" }, { "include": "#mut" }, { "include": "#let" }, { "include": "#types" }, { "include": "#assert" }, { "include": "#literals" }, { "include": "#control" }, { "include": "#move_copy" }, { "include": "#resource_methods" }, { "include": "#module_access" }, { "include": "#fun_call" }, { "include": "#block" }] }, "block-comments": { "comment": "Supported since https://github.com/diem/diem/pull/3714", "patterns": [{ "begin": "/\\*[\\*!](?![\\*/])", "comment": "Block documentation comment", "end": "\\*/", "name": "comment.block.documentation.move" }, { "begin": "/\\*", "comment": "Block comment", "end": "\\*/", "name": "comment.block.move" }] }, "comments": { "name": "meta.comments.move", "patterns": [{ "include": "#line-comments" }, { "include": "#block-comments" }] }, "const": { "begin": "\\b(const)\\b", "beginCaptures": { "1": { "name": "storage.modifier.const.move" } }, "end": ";", "name": "meta.const.move", "patterns": [{ "include": "#comments" }, { "include": "#primitives" }, { "include": "#vector" }, { "include": "#literals" }, { "match": "\\b([\\w_]+)\\b", "name": "constant.other.move" }] }, "control": { "comment": "Control flow", "match": "\\b(return|while|loop|if|else|break|continue|abort)\\b", "name": "keyword.control.move" }, "entry_fun": { "begin": "\\b(entry)\\b", "beginCaptures": { "1": { "name": "storage.modifier.entry.move" } }, "comment": "entry fun name() {}", "end": "(?<=})", "name": "meta.entry_fun.move", "patterns": [{ "include": "#comments" }, { "comment": "entry native function", "match": "\\b(native)\\b", "name": "storage.modifier.native.move" }, { "comment": "entry public function", "match": "\\b(public)\\b", "name": "storage.modifier.public.move" }, { "include": "#fun" }] }, "friend": { "begin": "\\b(friend)\\b", "beginCaptures": { "1": { "name": "storage.modifier.type.move" } }, "end": ";", "name": "meta.friend.move", "patterns": [{ "include": "#comments" }, { "include": "#address_literal" }, { "comment": "Name of the imported module", "match": "\\b(\\w+)\\b", "name": "entity.name.type.module.move" }] }, "fun": { "patterns": [{ "include": "#fun_signature" }, { "include": "#fun_body" }] }, "fun_body": { "begin": "{", "comment": "Function body", "end": "}", "name": "meta.fun_body.move", "patterns": [{ "include": "#comments" }, { "include": "#import" }, { "include": "#as" }, { "include": "#mut" }, { "include": "#let" }, { "include": "#types" }, { "include": "#assert" }, { "include": "#literals" }, { "include": "#control" }, { "include": "#move_copy" }, { "include": "#resource_methods" }, { "include": "#self_access" }, { "include": "#module_access" }, { "include": "#fun_call" }, { "include": "#block" }] }, "fun_call": { "begin": "\\b(\\w+)\\s*(?:<[\\w\\s,]+>)?\\s*[(]", "beginCaptures": { "1": { "name": "entity.name.function.call.move" } }, "comment": "Function call", "end": "[)]", "name": "meta.fun_call.move", "patterns": [{ "include": "#comments" }, { "include": "#resource_methods" }, { "include": "#self_access" }, { "include": "#module_access" }, { "include": "#move_copy" }, { "include": "#literals" }, { "include": "#fun_call" }, { "include": "#block" }, { "include": "#mut" }, { "include": "#as" }] }, "fun_signature": { "begin": "\\b(fun)\\b", "beginCaptures": { "1": { "name": "storage.modifier.fun.move" } }, "comment": "Function signature", "end": "(?=[;{])", "name": "meta.fun_signature.move", "patterns": [{ "include": "#comments" }, { "include": "#module_access" }, { "include": "#types" }, { "include": "#mut" }, { "begin": "(?<=fun)", "comment": "Function name", "end": "(?=[<(])", "name": "meta.function_name.move", "patterns": [{ "include": "#comments" }, { "match": "\\b(\\w+)\\b", "name": "entity.name.function.move" }] }, { "include": "#type_param" }, { "begin": "[(]", "comment": "Parentheses", "end": "[)]", "name": "meta.parentheses.move", "patterns": [{ "include": "#comments" }, { "include": "#self_access" }, { "include": "#module_access" }, { "include": "#types" }, { "include": "#mut" }] }, { "comment": "Keyword acquires", "match": "\\b(acquires)\\b", "name": "storage.modifier" }] }, "import": { "begin": "\\b(use)\\b", "beginCaptures": { "1": { "name": "storage.modifier.type.move" } }, "end": ";", "name": "meta.import.move", "patterns": [{ "include": "#comments" }, { "include": "#address_literal" }, { "include": "#as-import" }, { "comment": "Uppercase entities", "match": "\\b([A-Z]\\w*)\\b", "name": "entity.name.type.move" }, { "begin": "{", "comment": "Module members", "end": "}", "patterns": [{ "include": "#comments" }, { "include": "#as-import" }, { "comment": "Uppercase entities", "match": "\\b([A-Z]\\w*)\\b", "name": "entity.name.type.move" }] }, { "comment": "Name of the imported module", "match": "\\b(\\w+)\\b", "name": "meta.entity.name.type.module.move" }] }, "let": { "comment": "Keyword let", "match": "\\b(let)\\b", "name": "keyword.control.move" }, "line-comments": { "begin": "//", "comment": "Single-line comment", "end": "$", "name": "comment.line.double-slash.move" }, "literals": { "patterns": [{ "comment": "Hex literal (still to find out)", "match": "0x[_a-fA-F0-9]+(?:[iu](?:8|16|32|64|size))?", "name": "constant.numeric.hex.move" }, { "comment": "Numeric literal", "match": "(?<!(?:\\w|(?:(?<!\\.)\\.)))[0-9][_0-9]*(?:\\.(?!\\.)(?:[0-9][_0-9]*)?)?(?:[eE][+\\-]?[_0-9]+)?(?:[u](?:8|16|32|64|128|256))?", "name": "constant.numeric.move" }, { "captures": { "1": { "name": "constant.character.move" } }, "comment": "Bytearray hex literal", "match": '\\b(?:h)("[a-fA-F0-9]+")' }, { "begin": '\\bb"', "comment": "ASCII Bytestring literal", "end": '"', "name": "meta.ascii_literal.move", "patterns": [{ "comment": "Special symbol escape", "match": '\\\\[nrt\\0"]', "name": "constant.character.escape.move" }, { "comment": "HEX Escape", "match": "\\\\x[a-fA-F0-9][A-Fa-f0-9]", "name": "constant.character.escape.hex.move" }, { "comment": "ASCII Character", "match": "[\\x00-\\x7F]", "name": "string.quoted.double.raw.move" }] }, { "captures": { "1": { "name": "constant.numeric.hex.move" } }, "comment": "vector<u8> as hex literal: x", "match": 'x"([A-F0-9a-f]+)"', "name": "meta.hex_literal.move" }, { "comment": "Booleans", "match": "\\b(?:true|false)\\b", "name": "constant.language.boolean.move" }, { "include": "#address_literal" }] }, "macros": { "match": '#\\[(?:[\\w0-9=,_\\(\\)\\s"\\:=]+)\\]', "name": "support.constant.macro.move" }, "module": { "begin": "\\b(module|spec)\\b", "beginCaptures": { "1": { "name": "storage.modifier.type.move" } }, "comment": "Module definition", "end": "(?<=})", "name": "meta.module.move", "patterns": [{ "include": "#comments" }, { "begin": "(?<=(module|spec))", "comment": "Module name", "end": "(?={)", "patterns": [{ "include": "#comments" }, { "begin": "(?<=(module|spec))", "comment": "Module namespace / address", "end": "(?=[(::){])", "name": "constant.other.move" }, { "begin": "(?<=::)", "comment": "Module name", "end": "(?=[\\s{])", "name": "entity.name.type.move" }] }, { "begin": "{", "comment": "Module scope", "end": "}", "name": "meta.module_scope.move", "patterns": [{ "include": "#comments" }, { "include": "#macros" }, { "include": "#import" }, { "include": "#friend" }, { "include": "#const" }, { "include": "#struct" }, { "include": "#entry_fun" }, { "include": "#native_fun" }, { "include": "#public_fun" }, { "include": "#fun" }, { "include": "#spec" }, { "include": "#block" }] }] }, "module_access": { "captures": { "1": { "name": "meta.entity.name.type.accessed.module.move" }, "2": { "name": "entity.name.function.call.move" } }, "comment": "Use of module type or method", "match": "\\b(\\w+)::(\\w+)\\b", "name": "meta.module_access.move" }, "move_copy": { "comment": "Keywords move and copy", "match": "\\b(move|copy)\\b", "name": "variable.language.move" }, "mut": { "comment": "&mut reference", "match": "(?<=&)(mut)\\b", "name": "storage.modifier.mut.move" }, "native_fun": { "begin": "\\b(native)\\b", "beginCaptures": { "1": { "name": "storage.modifier.native.move" } }, "comment": "Native function", "end": "(?<=[;}])", "name": "meta.native_fun.move", "patterns": [{ "include": "#comments" }, { "comment": "native public function", "match": "\\b(public)\\b", "name": "storage.modifier.public.move" }, { "comment": "native entry function", "match": "\\b(entry)\\b", "name": "storage.modifier.entry.move" }, { "include": "#fun_signature" }] }, "phantom": { "comment": "Keyword phantom inside type parameters", "match": "\\b(phantom)\\b", "name": "keyword.control.phantom.move" }, "primitives": { "comment": "Primitive types", "match": "\\b(u8|u16|u32|u64|u128|u256|address|bool|signer)\\b", "name": "support.type.primitives.move" }, "public_fun": { "begin": "\\b(public)\\b", "beginCaptures": { "1": { "name": "storage.modifier.public.move" } }, "comment": "Public function", "end": "(?<=[;}])", "name": "meta.public_fun.move", "patterns": [{ "include": "#comments" }, { "comment": "Public native function", "match": "\\b(native)\\b", "name": "storage.modifier.native.move" }, { "comment": "Public entry function", "match": "\\b(entry)\\b", "name": "storage.modifier.entry.move" }, { "begin": "\\(", "comment": "Script visibility", "end": "\\)", "patterns": [{ "include": "#comments" }, { "comment": "Friend or Script visibility", "match": "\\b(script|friend)\\b", "name": "storage.modifier.public.script.move" }] }, { "include": "#fun" }] }, "resource_methods": { "comment": "Methods to work with resource", "match": "\\b(borrow_global|borrow_global_mut|exists|move_from|move_to_sender|move_to)\\b", "name": "support.function.typed.move" }, "script": { "begin": "\\b(script)\\b", "beginCaptures": { "1": { "name": "storage.modifier.script.move" } }, "end": "(?<=})", "name": "meta.script.move", "patterns": [{ "include": "#comments" }, { "begin": "{", "comment": "Script scope", "end": "}", "name": "meta.script_scope.move", "patterns": [{ "include": "#const" }, { "include": "#comments" }, { "include": "#import" }, { "include": "#fun" }] }] }, "self_access": { "captures": { "1": { "name": "variable.language.self.move" }, "2": { "name": "entity.name.function.call.move" } }, "comment": "Use of Self", "match": "\\b(Self)::(\\w+)\\b", "name": "meta.self_access.move" }, "spec": { "begin": "\\b(spec)\\b", "beginCaptures": { "1": { "name": "storage.modifier.spec.move" } }, "end": "(?<=[;}])", "name": "meta.spec.move", "patterns": [{ "comment": "Spec target", "match": "\\b(module|schema|struct|fun)", "name": "storage.modifier.spec.target.move" }, { "comment": "Spec define inline", "match": "\\b(define)", "name": "storage.modifier.spec.define.move" }, { "comment": "Target name", "match": "\\b(\\w+)\\b", "name": "entity.name.function.move" }, { "begin": "{", "comment": "Spec block", "end": "}", "patterns": [{ "include": "#comments" }, { "include": "#spec_block" }, { "include": "#spec_types" }, { "include": "#spec_define" }, { "include": "#spec_keywords" }, { "include": "#control" }, { "include": "#fun_call" }, { "include": "#literals" }, { "include": "#types" }, { "include": "#let" }] }] }, "spec_block": { "begin": "{", "comment": "Spec block", "end": "}", "name": "meta.spec_block.move", "patterns": [{ "include": "#comments" }, { "include": "#spec_block" }, { "include": "#spec_types" }, { "include": "#fun_call" }, { "include": "#literals" }, { "include": "#control" }, { "include": "#types" }, { "include": "#let" }] }, "spec_define": { "begin": "\\b(define)\\b", "beginCaptures": { "1": { "name": "keyword.control.move.spec" } }, "comment": "Spec define keyword", "end": "(?=[;{])", "name": "meta.spec_define.move", "patterns": [{ "include": "#comments" }, { "include": "#spec_types" }, { "include": "#types" }, { "begin": "(?<=define)", "comment": "Function name", "end": "(?=[(])", "patterns": [{ "include": "#comments" }, { "match": "\\b(\\w+)\\b", "name": "entity.name.function.move" }] }] }, "spec_keywords": { "match": "\\b(global|pack|unpack|pragma|native|include|ensures|requires|invariant|apply|aborts_if|modifies)\\b", "name": "keyword.control.move.spec" }, "spec_types": { "comment": "Spec-only types", "match": "\\b(range|num|vector|bool|u8|u16|u32|u64|u128|u256|address)\\b", "name": "support.type.vector.move" }, "struct": { "begin": "\\b(struct)\\b", "beginCaptures": { "1": { "name": "storage.modifier.type.move" } }, "end": "(?<=})", "name": "meta.struct.move", "patterns": [{ "include": "#comments" }, { "begin": "(?<=struct)", "comment": "Struct definition", "end": "(?={)", "name": "meta.struct_def.move", "patterns": [{ "include": "#comments" }, { "comment": "Has Abilities", "match": "\\b(has)\\b", "name": "keyword.control.ability.has.move" }, { "comment": "Ability", "match": "\\b(store|key|drop|copy)\\b", "name": "entity.name.type.ability.move" }, { "comment": "Struct name", "match": "\\b(\\w+)\\b", "name": "entity.name.type.move" }, { "include": "#type_param" }] }, { "begin": "{", "comment": "Struct body", "end": "}", "name": "meta.struct_body.move", "patterns": [{ "include": "#comments" }, { "include": "#self_access" }, { "include": "#module_access" }, { "include": "#types" }] }] }, "type_param": { "begin": "<", "comment": "Generic type param", "end": ">", "name": "meta.generic_param.move", "patterns": [{ "include": "#comments" }, { "include": "#phantom" }, { "include": "#module_access" }, { "comment": "Trait-like condition", "match": "\\b(store|drop|key|copy)\\b", "name": "entity.name.type.kind.move" }] }, "types": { "comment": "Built-in types + vector", "name": "meta.types.move", "patterns": [{ "include": "#primitives" }, { "include": "#vector" }, { "comment": "Capitalized type names", "match": "\\b([A-Z][A-Za-z_]+)\\b", "name": "entity.name.type" }, { "comment": "All-uppercase const literal", "match": "\\b([A-Z_]+)\\b", "name": "constant.other.move" }] }, "vector": { "begin": "\\b(vector)<", "beginCaptures": { "1": { "name": "support.type.vector.move" } }, "end": ">", "name": "meta.vector.move", "patterns": [{ "include": "#primitives" }, { "include": "#vector" }] } }, "scopeName": "source.move" });
|
|
2
|
+
var move = [
|
|
3
|
+
lang
|
|
4
|
+
];
|
|
5
|
+
|
|
6
|
+
export { move as default };
|
package/dist/langs/razor.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import csharp from './csharp.mjs';
|
|
|
3
3
|
import './javascript.mjs';
|
|
4
4
|
import './css.mjs';
|
|
5
5
|
|
|
6
|
-
const lang = Object.freeze({ "displayName": "ASP.NET Razor", "fileTypes": ["razor", "cshtml"], "name": "razor", "patterns": [{ "include": "#razor-control-structures" }, { "include": "text.html.basic" }], "repository": { "addTagHelper-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.addTagHelper" }, "3": { "patterns": [{ "include": "#tagHelper-directive-argument" }] } }, "match": "(@)(addTagHelper)\\s+([^$]+)?", "name": "meta.directive" }, "attribute-directive": { "begin": "(@)(attribute)\\b\\s+", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.attribute" } }, "end": "(?<=\\])|$", "name": "meta.directive", "patterns": [{ "include": "source.cs#attribute-section" }] }, "await-prefix": { "match": "(await)\\s+", "name": "keyword.other.await.cs" }, "balanced-brackets-csharp": { "begin": "(\\[)", "beginCaptures": { "1": { "name": "punctuation.squarebracket.open.cs" } }, "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.squarebracket.close.cs" } }, "name": "razor.test.balanced.brackets", "patterns": [{ "include": "source.cs" }] }, "balanced-parenthesis-csharp": { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.parenthesis.open.cs" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.parenthesis.close.cs" } }, "name": "razor.test.balanced.parenthesis", "patterns": [{ "include": "source.cs" }] }, "catch-clause": { "begin": "(?:^|(?<=}))\\s*(catch)\\b\\s*?(?=[\\n\\(\\{])", "beginCaptures": { "1": { "name": "keyword.control.try.catch.cs" } }, "end": "(?<=})", "name": "meta.statement.catch.razor", "patterns": [{ "include": "#catch-condition" }, { "include": "source.cs#when-clause" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "catch-condition": { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.parenthesis.open.cs" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.parenthesis.close.cs" } }, "patterns": [{ "captures": { "1": { "patterns": [{ "include": "source.cs#type" }] }, "6": { "name": "entity.name.variable.local.cs" } }, "match": "(?x)\n(?<type-name>\n(?:\n(?:\n(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)?\n(?<name-and-type-args>\n\\g<identifier>\\s*\n(?<type-args>\\s*<(?:[^<>]|\\g<type-args>)+>\\s*)?\n)\n(?:\\s*\\.\\s*\\g<name-and-type-args>)* |\n(?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n)\n(?:\\s*\\?\\s*)?\n(?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)*\n)\n)\\s*\n(?:(\\g<identifier>)\\b)?" }] }, "code-directive": { "begin": "(@)(code)((?=\\{)|\\s+)", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.code" } }, "end": "(?<=})|\\s", "patterns": [{ "include": "#directive-codeblock" }] }, "csharp-code-block": { "begin": "(\\{)", "beginCaptures": { "1": { "name": "punctuation.curlybrace.open.cs" } }, "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.curlybrace.close.cs" } }, "name": "meta.structure.razor.csharp.codeblock", "patterns": [{ "include": "#razor-codeblock-body" }] }, "csharp-condition": { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.parenthesis.open.cs" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.parenthesis.close.cs" } }, "patterns": [{ "include": "source.cs#local-variable-declaration" }, { "include": "source.cs#expression" }, { "include": "source.cs#punctuation-comma" }, { "include": "source.cs#punctuation-semicolon" }] }, "directive-codeblock": { "begin": "(\\{)", "beginCaptures": { "1": { "name": "keyword.control.razor.directive.codeblock.open" } }, "contentName": "source.cs", "end": "(\\})", "endCaptures": { "1": { "name": "keyword.control.razor.directive.codeblock.close" } }, "name": "meta.structure.razor.directive.codeblock", "patterns": [{ "include": "source.cs#class-or-struct-members" }] }, "directive-markupblock": { "begin": "(\\{)", "beginCaptures": { "1": { "name": "keyword.control.razor.directive.codeblock.open" } }, "end": "(\\})", "endCaptures": { "1": { "name": "keyword.control.razor.directive.codeblock.close" } }, "name": "meta.structure.razor.directive.markblock", "patterns": [{ "include": "$self" }] }, "directives": { "patterns": [{ "include": "#code-directive" }, { "include": "#functions-directive" }, { "include": "#page-directive" }, { "include": "#addTagHelper-directive" }, { "include": "#removeTagHelper-directive" }, { "include": "#tagHelperPrefix-directive" }, { "include": "#model-directive" }, { "include": "#inherits-directive" }, { "include": "#implements-directive" }, { "include": "#namespace-directive" }, { "include": "#inject-directive" }, { "include": "#attribute-directive" }, { "include": "#section-directive" }, { "include": "#layout-directive" }, { "include": "#using-directive" }] }, "do-statement": { "begin": "(?:(@))(do)\\b\\s", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.loop.do.cs" } }, "end": "(?<=})", "name": "meta.statement.do.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "do-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(do)\\b\\s", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.loop.do.cs" } }, "end": "(?<=})", "name": "meta.statement.do.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "else-part": { "begin": "(?:^|(?<=}))\\s*(else)\\b\\s*?(?: (if))?\\s*?(?=[\\n\\(\\{])", "beginCaptures": { "1": { "name": "keyword.control.conditional.else.cs" }, "2": { "name": "keyword.control.conditional.if.cs" } }, "end": "(?<=})", "name": "meta.statement.else.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "escaped-transition": { "match": "@@", "name": "constant.character.escape.razor.transition" }, "explicit-razor-expression": { "begin": "(@)\\(", "beginCaptures": { "0": { "name": "keyword.control.cshtml" }, "1": { "patterns": [{ "include": "#transition" }] } }, "end": "\\)", "endCaptures": { "0": { "name": "keyword.control.cshtml" } }, "name": "meta.expression.explicit.cshtml", "patterns": [{ "include": "source.cs#expression" }] }, "finally-clause": { "begin": "(?:^|(?<=}))\\s*(finally)\\b\\s*?(?=[\\n\\{])", "beginCaptures": { "1": { "name": "keyword.control.try.finally.cs" } }, "end": "(?<=})", "name": "meta.statement.finally.razor", "patterns": [{ "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "for-statement": { "begin": "(?:(@))(for)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.loop.for.cs" } }, "end": "(?<=})", "name": "meta.statement.for.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "for-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(for)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.loop.for.cs" } }, "end": "(?<=})", "name": "meta.statement.for.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "foreach-condition": { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.parenthesis.open.cs" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.parenthesis.close.cs" } }, "patterns": [{ "captures": { "1": { "name": "keyword.other.var.cs" }, "2": { "patterns": [{ "include": "source.cs#type" }] }, "7": { "name": "entity.name.variable.local.cs" }, "8": { "name": "keyword.control.loop.in.cs" } }, "match": "(?x)\n(?:\n(\\bvar\\b)|\n(?<type-name>\n(?:\n(?:\n(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)?\n(?<name-and-type-args>\n\\g<identifier>\\s*\n(?<type-args>\\s*<(?:[^<>]|\\g<type-args>)+>\\s*)?\n)\n(?:\\s*\\.\\s*\\g<name-and-type-args>)* |\n(?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n)\n(?:\\s*\\?\\s*)?\n(?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)*\n)\n)\n)\\s+\n(\\g<identifier>)\\s+\n\\b(in)\\b" }, { "captures": { "1": { "name": "keyword.other.var.cs" }, "2": { "patterns": [{ "include": "source.cs#tuple-declaration-deconstruction-element-list" }] }, "3": { "name": "keyword.control.loop.in.cs" } }, "match": "(?x)\n(?:\\b(var)\\b\\s*)?\n(?<tuple>\\((?:[^\\(\\)]|\\g<tuple>)+\\))\\s+\n\\b(in)\\b" }, { "include": "source.cs#expression" }] }, "foreach-statement": { "begin": "(?:(@)(await\\s+)?)(foreach)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "patterns": [{ "include": "#await-prefix" }] }, "3": { "name": "keyword.control.loop.foreach.cs" } }, "end": "(?<=})", "name": "meta.statement.foreach.razor", "patterns": [{ "include": "#foreach-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "foreach-statement-with-optional-transition": { "begin": "(?:^\\s*|(@)(await\\s+)?)(foreach)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "patterns": [{ "include": "#await-prefix" }] }, "3": { "name": "keyword.control.loop.foreach.cs" } }, "end": "(?<=})", "name": "meta.statement.foreach.razor", "patterns": [{ "include": "#foreach-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "functions-directive": { "begin": "(@)(functions)((?=\\{)|\\s+)", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.functions" } }, "end": "(?<=})|\\s", "patterns": [{ "include": "#directive-codeblock" }] }, "if-statement": { "begin": "(?:(@))(if)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.conditional.if.cs" } }, "end": "(?<=})", "name": "meta.statement.if.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "if-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(if)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.conditional.if.cs" } }, "end": "(?<=})", "name": "meta.statement.if.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "implements-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.implements" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(@)(implements)\\s+([^$]+)?", "name": "meta.directive" }, "implicit-expression": { "begin": "(?<![[:alpha:][:alnum:]])(@)", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] } }, "contentName": "source.cs", "end": `(?=[\\s<>\\{\\}\\)\\]'"])`, "name": "meta.expression.implicit.cshtml", "patterns": [{ "include": "#await-prefix" }, { "include": "#implicit-expression-body" }] }, "implicit-expression-accessor": { "match": "(?<=\\.)[_[:alpha:]][_[:alnum:]]*", "name": "variable.other.object.property.cs" }, "implicit-expression-accessor-start": { "begin": "([_[:alpha:]][_[:alnum:]]*)", "beginCaptures": { "1": { "name": "variable.other.object.cs" } }, "end": `(?=[\\s<>\\{\\}\\)\\]'"])`, "patterns": [{ "include": "#implicit-expression-continuation" }] }, "implicit-expression-body": { "end": `(?=[\\s<>\\{\\}\\)\\]'"])`, "patterns": [{ "include": "#implicit-expression-invocation-start" }, { "include": "#implicit-expression-accessor-start" }] }, "implicit-expression-continuation": { "end": `(?=[\\s<>\\{\\}\\)\\]'"])`, "patterns": [{ "include": "#balanced-parenthesis-csharp" }, { "include": "#balanced-brackets-csharp" }, { "include": "#implicit-expression-invocation" }, { "include": "#implicit-expression-accessor" }, { "include": "#implicit-expression-extension" }] }, "implicit-expression-dot-operator": { "captures": { "1": { "name": "punctuation.accessor.cs" } }, "match": "(\\.)(?=[_[:alpha:]][_[:alnum:]]*)" }, "implicit-expression-invocation": { "match": "(?<=\\.)[_[:alpha:]][_[:alnum:]]*(?=\\()", "name": "entity.name.function.cs" }, "implicit-expression-invocation-start": { "begin": "([_[:alpha:]][_[:alnum:]]*)(?=\\()", "beginCaptures": { "1": { "name": "entity.name.function.cs" } }, "end": `(?=[\\s<>\\{\\}\\)\\]'"])`, "patterns": [{ "include": "#implicit-expression-continuation" }] }, "implicit-expression-null-conditional-operator": { "captures": { "1": { "name": "keyword.operator.null-conditional.cs" } }, "match": "(\\?)(?=[.\\[])" }, "implicit-expression-null-forgiveness-operator": { "captures": { "1": { "name": "keyword.operator.logical.cs" } }, "match": "(\\!)(?=(?:\\.[_[:alpha:]][_[:alnum:]]*)|\\?|[\\[\\(])" }, "implicit-expression-operator": { "patterns": [{ "include": "#implicit-expression-dot-operator" }, { "include": "#implicit-expression-null-conditional-operator" }, { "include": "#implicit-expression-null-forgiveness-operator" }] }, "inherits-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.inherits" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(@)(inherits)\\s+([^$]+)?", "name": "meta.directive" }, "inject-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.inject" }, "3": { "patterns": [{ "include": "source.cs#type" }] }, "4": { "name": "entity.name.variable.property.cs" } }, "match": "(@)(inject)\\s*([\\S\\s]+?)?\\s*([_[:alpha:]][_[:alnum:]]*)?\\s*(?=$)", "name": "meta.directive" }, "layout-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.layout" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(@)(layout)\\s+([^$]+)?", "name": "meta.directive" }, "lock-statement": { "begin": "(?:(@))(lock)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.other.lock.cs" } }, "end": "(?<=})", "name": "meta.statement.lock.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "lock-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(lock)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.other.lock.cs" } }, "end": "(?<=})", "name": "meta.statement.lock.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "model-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.model" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(@)(model)\\s+([^$]+)?", "name": "meta.directive" }, "namespace-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.namespace" }, "3": { "patterns": [{ "include": "#namespace-directive-argument" }] } }, "match": "(@)(namespace)\\s+([^\\s]+)?", "name": "meta.directive" }, "namespace-directive-argument": { "captures": { "1": { "name": "entity.name.type.namespace.cs" }, "2": { "name": "punctuation.accessor.cs" } }, "match": "([_[:alpha:]][_[:alnum:]]*)(\\.)?" }, "non-void-tag": { "begin": "(?=<(!)?([^/\\s>]+)(\\s|/?>))", "end": "(</)(\\2)\\s*(>)|(/>)", "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": "(<)(!)?([^/\\s>]+)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "constant.character.escape.razor.tagHelperOptOut" }, "3": { "name": "entity.name.tag.html" } }, "end": "(?=/?>)", "patterns": [{ "include": "#razor-control-structures" }, { "include": "text.html.basic#attribute" }] }, { "begin": ">", "beginCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "end": "(?=</)", "patterns": [{ "include": "#wellformed-html" }, { "include": "$self" }] }] }, "optionally-transitioned-csharp-control-structures": { "patterns": [{ "include": "#using-statement-with-optional-transition" }, { "include": "#if-statement-with-optional-transition" }, { "include": "#else-part" }, { "include": "#foreach-statement-with-optional-transition" }, { "include": "#for-statement-with-optional-transition" }, { "include": "#while-statement" }, { "include": "#switch-statement-with-optional-transition" }, { "include": "#lock-statement-with-optional-transition" }, { "include": "#do-statement-with-optional-transition" }, { "include": "#try-statement-with-optional-transition" }] }, "optionally-transitioned-razor-control-structures": { "patterns": [{ "include": "#razor-comment" }, { "include": "#razor-codeblock" }, { "include": "#explicit-razor-expression" }, { "include": "#escaped-transition" }, { "include": "#directives" }, { "include": "#optionally-transitioned-csharp-control-structures" }, { "include": "#implicit-expression" }] }, "page-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.page" }, "3": { "patterns": [{ "include": "source.cs#string-literal" }] } }, "match": "(@)(page)\\s+([^$]+)?", "name": "meta.directive" }, "razor-codeblock": { "begin": "(@)(\\{)", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.codeblock.open" } }, "contentName": "source.cs", "end": "(\\})", "endCaptures": { "1": { "name": "keyword.control.razor.directive.codeblock.close" } }, "name": "meta.structure.razor.codeblock", "patterns": [{ "include": "#razor-codeblock-body" }] }, "razor-codeblock-body": { "patterns": [{ "include": "#text-tag" }, { "include": "#wellformed-html" }, { "include": "#razor-single-line-markup" }, { "include": "#optionally-transitioned-razor-control-structures" }, { "include": "source.cs" }] }, "razor-comment": { "begin": "(@)(\\*)", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.comment.star" } }, "contentName": "comment.block.razor", "end": "(\\*)(@)", "endCaptures": { "1": { "name": "keyword.control.razor.comment.star" }, "2": { "patterns": [{ "include": "#transition" }] } }, "name": "meta.comment.razor" }, "razor-control-structures": { "patterns": [{ "include": "#razor-comment" }, { "include": "#razor-codeblock" }, { "include": "#explicit-razor-expression" }, { "include": "#escaped-transition" }, { "include": "#directives" }, { "include": "#transitioned-csharp-control-structures" }, { "include": "#implicit-expression" }] }, "razor-single-line-markup": { "captures": { "1": { "name": "keyword.control.razor.singleLineMarkup" }, "2": { "patterns": [{ "include": "#razor-control-structures" }, { "include": "text.html.basic" }] } }, "match": "(\\@\\:)([^$]*)$" }, "removeTagHelper-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.removeTagHelper" }, "3": { "patterns": [{ "include": "#tagHelper-directive-argument" }] } }, "match": "(@)(removeTagHelper)\\s+([^$]+)?", "name": "meta.directive" }, "section-directive": { "begin": "(@)(section)\\b\\s+([_[:alpha:]][_[:alnum:]]*)?", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.section" }, "3": { "name": "variable.other.razor.directive.sectionName" } }, "end": "(?<=})", "name": "meta.directive.block", "patterns": [{ "include": "#directive-markupblock" }] }, "switch-code-block": { "begin": "(\\{)", "beginCaptures": { "1": { "name": "punctuation.curlybrace.open.cs" } }, "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.curlybrace.close.cs" } }, "name": "meta.structure.razor.csharp.codeblock.switch", "patterns": [{ "include": "source.cs#switch-label" }, { "include": "#razor-codeblock-body" }] }, "switch-statement": { "begin": "(?:(@))(switch)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.switch.cs" } }, "end": "(?<=})", "name": "meta.statement.switch.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#switch-code-block" }, { "include": "#razor-codeblock-body" }] }, "switch-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(switch)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.switch.cs" } }, "end": "(?<=})", "name": "meta.statement.switch.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#switch-code-block" }, { "include": "#razor-codeblock-body" }] }, "tagHelper-directive-argument": { "patterns": [{ "include": "source.cs#string-literal" }, { "include": "#unquoted-string-argument" }] }, "tagHelperPrefix-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.tagHelperPrefix" }, "3": { "patterns": [{ "include": "#tagHelper-directive-argument" }] } }, "match": "(@)(tagHelperPrefix)\\s+([^$]+)?", "name": "meta.directive" }, "text-tag": { "begin": "(<text\\s*>)", "beginCaptures": { "1": { "name": "keyword.control.cshtml.transition.textTag.open" } }, "end": "(</text>)", "endCaptures": { "1": { "name": "keyword.control.cshtml.transition.textTag.close" } }, "patterns": [{ "include": "#wellformed-html" }, { "include": "$self" }] }, "transition": { "match": "@", "name": "keyword.control.cshtml.transition" }, "transitioned-csharp-control-structures": { "patterns": [{ "include": "#using-statement" }, { "include": "#if-statement" }, { "include": "#else-part" }, { "include": "#foreach-statement" }, { "include": "#for-statement" }, { "include": "#while-statement" }, { "include": "#switch-statement" }, { "include": "#lock-statement" }, { "include": "#do-statement" }, { "include": "#try-statement" }] }, "try-block": { "begin": "(?:(@))(try)\\b\\s*", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.try.cs" } }, "end": "(?<=})", "name": "meta.statement.try.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "try-block-with-optional-transition": { "begin": "(?:^\\s*|(@))(try)\\b\\s*", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.try.cs" } }, "end": "(?<=})", "name": "meta.statement.try.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "try-statement": { "patterns": [{ "include": "#try-block" }, { "include": "#catch-clause" }, { "include": "#finally-clause" }] }, "try-statement-with-optional-transition": { "patterns": [{ "include": "#try-block-with-optional-transition" }, { "include": "#catch-clause" }, { "include": "#finally-clause" }] }, "unquoted-string-argument": { "match": "[^$]+", "name": "string.quoted.double.cs" }, "using-alias-directive": { "captures": { "1": { "name": "entity.name.type.alias.cs" }, "2": { "name": "keyword.operator.assignment.cs" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "([_[:alpha:]][_[:alnum:]]*)\\b\\s*(=)\\s*(.+)\\s*" }, "using-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.other.using.cs" }, "3": { "patterns": [{ "include": "#using-static-directive" }, { "include": "#using-alias-directive" }, { "include": "#using-standard-directive" }] }, "4": { "name": "keyword.control.razor.optionalSemicolon" } }, "match": "(@)(using)\\b\\s+(?!\\(|\\s)(.+?)?(;)?$", "name": "meta.directive" }, "using-standard-directive": { "captures": { "1": { "name": "entity.name.type.namespace.cs" } }, "match": "([_[:alpha:]][_[:alnum:]]*)\\s*" }, "using-statement": { "begin": "(?:(@))(using)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.other.using.cs" } }, "end": "(?<=})", "name": "meta.statement.using.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "using-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(using)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.other.using.cs" } }, "end": "(?<=})", "name": "meta.statement.using.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "using-static-directive": { "captures": { "1": { "name": "keyword.other.static.cs" }, "2": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(static)\\b\\s+(.+)" }, "void-tag": { "begin": "(?i)(<)(!)?(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "constant.character.escape.razor.tagHelperOptOut" }, "3": { "name": "entity.name.tag.html" } }, "end": "/?>", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.structure.$3.void.html", "patterns": [{ "include": "text.html.basic#attribute" }] }, "wellformed-html": { "patterns": [{ "include": "#void-tag" }, { "include": "#non-void-tag" }] }, "while-statement": { "begin": "(?:(@)|^\\s*|(?<=})\\s*)(while)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.loop.while.cs" } }, "end": "(?<=})|(;)", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cs" } }, "name": "meta.statement.while.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] } }, "scopeName": "text.aspnetcorerazor", "embeddedLangs": ["html", "csharp"] });
|
|
6
|
+
const lang = Object.freeze({ "displayName": "ASP.NET Razor", "fileTypes": ["razor", "cshtml"], "name": "razor", "patterns": [{ "include": "#razor-control-structures" }, { "include": "text.html.basic" }], "repository": { "addTagHelper-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.addTagHelper" }, "3": { "patterns": [{ "include": "#tagHelper-directive-argument" }] } }, "match": "(@)(addTagHelper)\\s+([^$]+)?", "name": "meta.directive" }, "attribute-directive": { "begin": "(@)(attribute)\\b\\s+", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.attribute" } }, "end": "(?<=\\])|$", "name": "meta.directive", "patterns": [{ "include": "source.cs#attribute-section" }] }, "await-prefix": { "match": "(await)\\s+", "name": "keyword.other.await.cs" }, "balanced-brackets-csharp": { "begin": "(\\[)", "beginCaptures": { "1": { "name": "punctuation.squarebracket.open.cs" } }, "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.squarebracket.close.cs" } }, "name": "razor.test.balanced.brackets", "patterns": [{ "include": "source.cs" }] }, "balanced-parenthesis-csharp": { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.parenthesis.open.cs" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.parenthesis.close.cs" } }, "name": "razor.test.balanced.parenthesis", "patterns": [{ "include": "source.cs" }] }, "catch-clause": { "begin": "(?:^|(?<=}))\\s*(catch)\\b\\s*?(?=[\\n\\(\\{])", "beginCaptures": { "1": { "name": "keyword.control.try.catch.cs" } }, "end": "(?<=})", "name": "meta.statement.catch.razor", "patterns": [{ "include": "#catch-condition" }, { "include": "source.cs#when-clause" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "catch-condition": { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.parenthesis.open.cs" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.parenthesis.close.cs" } }, "patterns": [{ "captures": { "1": { "patterns": [{ "include": "source.cs#type" }] }, "6": { "name": "entity.name.variable.local.cs" } }, "match": "(?x)\n(?<type-name>\n(?:\n(?:\n(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)?\n(?<name-and-type-args>\n\\g<identifier>\\s*\n(?<type-args>\\s*<(?:[^<>]|\\g<type-args>)+>\\s*)?\n)\n(?:\\s*\\.\\s*\\g<name-and-type-args>)* |\n(?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n)\n(?:\\s*\\?\\s*)?\n(?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)*\n)\n)\\s*\n(?:(\\g<identifier>)\\b)?" }] }, "code-directive": { "begin": "(@)(code)((?=\\{)|\\s+)", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.code" } }, "end": "(?<=})|\\s", "patterns": [{ "include": "#directive-codeblock" }] }, "csharp-code-block": { "begin": "(\\{)", "beginCaptures": { "1": { "name": "punctuation.curlybrace.open.cs" } }, "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.curlybrace.close.cs" } }, "name": "meta.structure.razor.csharp.codeblock", "patterns": [{ "include": "#razor-codeblock-body" }] }, "csharp-condition": { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.parenthesis.open.cs" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.parenthesis.close.cs" } }, "patterns": [{ "include": "source.cs#local-variable-declaration" }, { "include": "source.cs#expression" }, { "include": "source.cs#punctuation-comma" }, { "include": "source.cs#punctuation-semicolon" }] }, "directive-codeblock": { "begin": "(\\{)", "beginCaptures": { "1": { "name": "keyword.control.razor.directive.codeblock.open" } }, "contentName": "source.cs", "end": "(\\})", "endCaptures": { "1": { "name": "keyword.control.razor.directive.codeblock.close" } }, "name": "meta.structure.razor.directive.codeblock", "patterns": [{ "include": "source.cs#class-or-struct-members" }] }, "directive-markupblock": { "begin": "(\\{)", "beginCaptures": { "1": { "name": "keyword.control.razor.directive.codeblock.open" } }, "end": "(\\})", "endCaptures": { "1": { "name": "keyword.control.razor.directive.codeblock.close" } }, "name": "meta.structure.razor.directive.markblock", "patterns": [{ "include": "$self" }] }, "directives": { "patterns": [{ "include": "#code-directive" }, { "include": "#functions-directive" }, { "include": "#page-directive" }, { "include": "#addTagHelper-directive" }, { "include": "#removeTagHelper-directive" }, { "include": "#tagHelperPrefix-directive" }, { "include": "#model-directive" }, { "include": "#inherits-directive" }, { "include": "#implements-directive" }, { "include": "#namespace-directive" }, { "include": "#inject-directive" }, { "include": "#attribute-directive" }, { "include": "#section-directive" }, { "include": "#layout-directive" }, { "include": "#using-directive" }, { "include": "#rendermode-directive" }, { "include": "#preservewhitespace-directive" }, { "include": "#typeparam-directive" }] }, "do-statement": { "begin": "(?:(@))(do)\\b\\s", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.loop.do.cs" } }, "end": "(?<=})", "name": "meta.statement.do.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "do-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(do)\\b\\s", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.loop.do.cs" } }, "end": "(?<=})", "name": "meta.statement.do.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "else-part": { "begin": "(?:^|(?<=}))\\s*(else)\\b\\s*?(?: (if))?\\s*?(?=[\\n\\(\\{])", "beginCaptures": { "1": { "name": "keyword.control.conditional.else.cs" }, "2": { "name": "keyword.control.conditional.if.cs" } }, "end": "(?<=})", "name": "meta.statement.else.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "escaped-transition": { "match": "@@", "name": "constant.character.escape.razor.transition" }, "explicit-razor-expression": { "begin": "(@)\\(", "beginCaptures": { "0": { "name": "keyword.control.cshtml" }, "1": { "patterns": [{ "include": "#transition" }] } }, "end": "\\)", "endCaptures": { "0": { "name": "keyword.control.cshtml" } }, "name": "meta.expression.explicit.cshtml", "patterns": [{ "include": "source.cs#expression" }] }, "finally-clause": { "begin": "(?:^|(?<=}))\\s*(finally)\\b\\s*?(?=[\\n\\{])", "beginCaptures": { "1": { "name": "keyword.control.try.finally.cs" } }, "end": "(?<=})", "name": "meta.statement.finally.razor", "patterns": [{ "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "for-statement": { "begin": "(?:(@))(for)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.loop.for.cs" } }, "end": "(?<=})", "name": "meta.statement.for.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "for-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(for)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.loop.for.cs" } }, "end": "(?<=})", "name": "meta.statement.for.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "foreach-condition": { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.parenthesis.open.cs" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.parenthesis.close.cs" } }, "patterns": [{ "captures": { "1": { "name": "keyword.other.var.cs" }, "2": { "patterns": [{ "include": "source.cs#type" }] }, "7": { "name": "entity.name.variable.local.cs" }, "8": { "name": "keyword.control.loop.in.cs" } }, "match": "(?x)\n(?:\n(\\bvar\\b)|\n(?<type-name>\n(?:\n(?:\n(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)?\n(?<name-and-type-args>\n\\g<identifier>\\s*\n(?<type-args>\\s*<(?:[^<>]|\\g<type-args>)+>\\s*)?\n)\n(?:\\s*\\.\\s*\\g<name-and-type-args>)* |\n(?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n)\n(?:\\s*\\?\\s*)?\n(?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)*\n)\n)\n)\\s+\n(\\g<identifier>)\\s+\n\\b(in)\\b" }, { "captures": { "1": { "name": "keyword.other.var.cs" }, "2": { "patterns": [{ "include": "source.cs#tuple-declaration-deconstruction-element-list" }] }, "3": { "name": "keyword.control.loop.in.cs" } }, "match": "(?x)\n(?:\\b(var)\\b\\s*)?\n(?<tuple>\\((?:[^\\(\\)]|\\g<tuple>)+\\))\\s+\n\\b(in)\\b" }, { "include": "source.cs#expression" }] }, "foreach-statement": { "begin": "(?:(@)(await\\s+)?)(foreach)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "patterns": [{ "include": "#await-prefix" }] }, "3": { "name": "keyword.control.loop.foreach.cs" } }, "end": "(?<=})", "name": "meta.statement.foreach.razor", "patterns": [{ "include": "#foreach-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "foreach-statement-with-optional-transition": { "begin": "(?:^\\s*|(@)(await\\s+)?)(foreach)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "patterns": [{ "include": "#await-prefix" }] }, "3": { "name": "keyword.control.loop.foreach.cs" } }, "end": "(?<=})", "name": "meta.statement.foreach.razor", "patterns": [{ "include": "#foreach-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "functions-directive": { "begin": "(@)(functions)((?=\\{)|\\s+)", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.functions" } }, "end": "(?<=})|\\s", "patterns": [{ "include": "#directive-codeblock" }] }, "if-statement": { "begin": "(?:(@))(if)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.conditional.if.cs" } }, "end": "(?<=})", "name": "meta.statement.if.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "if-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(if)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.conditional.if.cs" } }, "end": "(?<=})", "name": "meta.statement.if.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "implements-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.implements" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(@)(implements)\\s+([^$]+)?", "name": "meta.directive" }, "implicit-expression": { "begin": "(?<![[:alpha:][:alnum:]])(@)", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] } }, "contentName": "source.cs", "end": `(?=[\\s<>\\{\\}\\)\\]'"])`, "name": "meta.expression.implicit.cshtml", "patterns": [{ "include": "#await-prefix" }, { "include": "#implicit-expression-body" }] }, "implicit-expression-accessor": { "match": "(?<=\\.)[_[:alpha:]][_[:alnum:]]*", "name": "variable.other.object.property.cs" }, "implicit-expression-accessor-start": { "begin": "([_[:alpha:]][_[:alnum:]]*)", "beginCaptures": { "1": { "name": "variable.other.object.cs" } }, "end": `(?=[\\s<>\\{\\}\\)\\]'"])`, "patterns": [{ "include": "#implicit-expression-continuation" }] }, "implicit-expression-body": { "end": `(?=[\\s<>\\{\\}\\)\\]'"])`, "patterns": [{ "include": "#implicit-expression-invocation-start" }, { "include": "#implicit-expression-accessor-start" }] }, "implicit-expression-continuation": { "end": `(?=[\\s<>\\{\\}\\)\\]'"])`, "patterns": [{ "include": "#balanced-parenthesis-csharp" }, { "include": "#balanced-brackets-csharp" }, { "include": "#implicit-expression-invocation" }, { "include": "#implicit-expression-accessor" }, { "include": "#implicit-expression-extension" }] }, "implicit-expression-dot-operator": { "captures": { "1": { "name": "punctuation.accessor.cs" } }, "match": "(\\.)(?=[_[:alpha:]][_[:alnum:]]*)" }, "implicit-expression-invocation": { "match": "(?<=\\.)[_[:alpha:]][_[:alnum:]]*(?=\\()", "name": "entity.name.function.cs" }, "implicit-expression-invocation-start": { "begin": "([_[:alpha:]][_[:alnum:]]*)(?=\\()", "beginCaptures": { "1": { "name": "entity.name.function.cs" } }, "end": `(?=[\\s<>\\{\\}\\)\\]'"])`, "patterns": [{ "include": "#implicit-expression-continuation" }] }, "implicit-expression-null-conditional-operator": { "captures": { "1": { "name": "keyword.operator.null-conditional.cs" } }, "match": "(\\?)(?=[.\\[])" }, "implicit-expression-null-forgiveness-operator": { "captures": { "1": { "name": "keyword.operator.logical.cs" } }, "match": "(\\!)(?=(?:\\.[_[:alpha:]][_[:alnum:]]*)|\\?|[\\[\\(])" }, "implicit-expression-operator": { "patterns": [{ "include": "#implicit-expression-dot-operator" }, { "include": "#implicit-expression-null-conditional-operator" }, { "include": "#implicit-expression-null-forgiveness-operator" }] }, "inherits-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.inherits" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(@)(inherits)\\s+([^$]+)?", "name": "meta.directive" }, "inject-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.inject" }, "3": { "patterns": [{ "include": "source.cs#type" }] }, "4": { "name": "entity.name.variable.property.cs" } }, "match": "(@)(inject)\\s*([\\S\\s]+?)?\\s*([_[:alpha:]][_[:alnum:]]*)?\\s*(?=$)", "name": "meta.directive" }, "layout-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.layout" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(@)(layout)\\s+([^$]+)?", "name": "meta.directive" }, "lock-statement": { "begin": "(?:(@))(lock)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.other.lock.cs" } }, "end": "(?<=})", "name": "meta.statement.lock.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "lock-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(lock)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.other.lock.cs" } }, "end": "(?<=})", "name": "meta.statement.lock.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "model-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.model" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(@)(model)\\s+([^$]+)?", "name": "meta.directive" }, "namespace-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.namespace" }, "3": { "patterns": [{ "include": "#namespace-directive-argument" }] } }, "match": "(@)(namespace)\\s+([^\\s]+)?", "name": "meta.directive" }, "namespace-directive-argument": { "captures": { "1": { "name": "entity.name.type.namespace.cs" }, "2": { "name": "punctuation.accessor.cs" } }, "match": "([_[:alpha:]][_[:alnum:]]*)(\\.)?" }, "non-void-tag": { "begin": "(?=<(!)?([^/\\s>]+)(\\s|/?>))", "end": "(</)(\\2)\\s*(>)|(/>)", "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": "(<)(!)?([^/\\s>]+)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "constant.character.escape.razor.tagHelperOptOut" }, "3": { "name": "entity.name.tag.html" } }, "end": "(?=/?>)", "patterns": [{ "include": "#razor-control-structures" }, { "include": "text.html.basic#attribute" }] }, { "begin": ">", "beginCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "end": "(?=</)", "patterns": [{ "include": "#wellformed-html" }, { "include": "$self" }] }] }, "optionally-transitioned-csharp-control-structures": { "patterns": [{ "include": "#using-statement-with-optional-transition" }, { "include": "#if-statement-with-optional-transition" }, { "include": "#else-part" }, { "include": "#foreach-statement-with-optional-transition" }, { "include": "#for-statement-with-optional-transition" }, { "include": "#while-statement" }, { "include": "#switch-statement-with-optional-transition" }, { "include": "#lock-statement-with-optional-transition" }, { "include": "#do-statement-with-optional-transition" }, { "include": "#try-statement-with-optional-transition" }] }, "optionally-transitioned-razor-control-structures": { "patterns": [{ "include": "#razor-comment" }, { "include": "#razor-codeblock" }, { "include": "#explicit-razor-expression" }, { "include": "#escaped-transition" }, { "include": "#directives" }, { "include": "#optionally-transitioned-csharp-control-structures" }, { "include": "#implicit-expression" }] }, "page-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.page" }, "3": { "patterns": [{ "include": "source.cs#string-literal" }] } }, "match": "(@)(page)\\s+([^$]+)?", "name": "meta.directive" }, "preservewhitespace-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.preservewhitespace" }, "3": { "patterns": [{ "include": "source.cs#boolean-literal" }] } }, "match": "(@)(preservewhitespace)\\s+([^$]+)?", "name": "meta.directive" }, "razor-codeblock": { "begin": "(@)(\\{)", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.codeblock.open" } }, "contentName": "source.cs", "end": "(\\})", "endCaptures": { "1": { "name": "keyword.control.razor.directive.codeblock.close" } }, "name": "meta.structure.razor.codeblock", "patterns": [{ "include": "#razor-codeblock-body" }] }, "razor-codeblock-body": { "patterns": [{ "include": "#text-tag" }, { "include": "#wellformed-html" }, { "include": "#razor-single-line-markup" }, { "include": "#optionally-transitioned-razor-control-structures" }, { "include": "source.cs" }] }, "razor-comment": { "begin": "(@)(\\*)", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.comment.star" } }, "contentName": "comment.block.razor", "end": "(\\*)(@)", "endCaptures": { "1": { "name": "keyword.control.razor.comment.star" }, "2": { "patterns": [{ "include": "#transition" }] } }, "name": "meta.comment.razor" }, "razor-control-structures": { "patterns": [{ "include": "#razor-comment" }, { "include": "#razor-codeblock" }, { "include": "#explicit-razor-expression" }, { "include": "#escaped-transition" }, { "include": "#directives" }, { "include": "#transitioned-csharp-control-structures" }, { "include": "#implicit-expression" }] }, "razor-single-line-markup": { "captures": { "1": { "name": "keyword.control.razor.singleLineMarkup" }, "2": { "patterns": [{ "include": "#razor-control-structures" }, { "include": "text.html.basic" }] } }, "match": "(\\@\\:)([^$]*)$" }, "removeTagHelper-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.removeTagHelper" }, "3": { "patterns": [{ "include": "#tagHelper-directive-argument" }] } }, "match": "(@)(removeTagHelper)\\s+([^$]+)?", "name": "meta.directive" }, "rendermode-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.rendermode" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(@)(rendermode)\\s+([^$]+)?", "name": "meta.directive" }, "section-directive": { "begin": "(@)(section)\\b\\s+([_[:alpha:]][_[:alnum:]]*)?", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.section" }, "3": { "name": "variable.other.razor.directive.sectionName" } }, "end": "(?<=})", "name": "meta.directive.block", "patterns": [{ "include": "#directive-markupblock" }] }, "switch-code-block": { "begin": "(\\{)", "beginCaptures": { "1": { "name": "punctuation.curlybrace.open.cs" } }, "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.curlybrace.close.cs" } }, "name": "meta.structure.razor.csharp.codeblock.switch", "patterns": [{ "include": "source.cs#switch-label" }, { "include": "#razor-codeblock-body" }] }, "switch-statement": { "begin": "(?:(@))(switch)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.switch.cs" } }, "end": "(?<=})", "name": "meta.statement.switch.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#switch-code-block" }, { "include": "#razor-codeblock-body" }] }, "switch-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(switch)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.switch.cs" } }, "end": "(?<=})", "name": "meta.statement.switch.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#switch-code-block" }, { "include": "#razor-codeblock-body" }] }, "tagHelper-directive-argument": { "patterns": [{ "include": "source.cs#string-literal" }, { "include": "#unquoted-string-argument" }] }, "tagHelperPrefix-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.tagHelperPrefix" }, "3": { "patterns": [{ "include": "#tagHelper-directive-argument" }] } }, "match": "(@)(tagHelperPrefix)\\s+([^$]+)?", "name": "meta.directive" }, "text-tag": { "begin": "(<text\\s*>)", "beginCaptures": { "1": { "name": "keyword.control.cshtml.transition.textTag.open" } }, "end": "(</text>)", "endCaptures": { "1": { "name": "keyword.control.cshtml.transition.textTag.close" } }, "patterns": [{ "include": "#wellformed-html" }, { "include": "$self" }] }, "transition": { "match": "@", "name": "keyword.control.cshtml.transition" }, "transitioned-csharp-control-structures": { "patterns": [{ "include": "#using-statement" }, { "include": "#if-statement" }, { "include": "#else-part" }, { "include": "#foreach-statement" }, { "include": "#for-statement" }, { "include": "#while-statement" }, { "include": "#switch-statement" }, { "include": "#lock-statement" }, { "include": "#do-statement" }, { "include": "#try-statement" }] }, "try-block": { "begin": "(?:(@))(try)\\b\\s*", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.try.cs" } }, "end": "(?<=})", "name": "meta.statement.try.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "try-block-with-optional-transition": { "begin": "(?:^\\s*|(@))(try)\\b\\s*", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.try.cs" } }, "end": "(?<=})", "name": "meta.statement.try.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "try-statement": { "patterns": [{ "include": "#try-block" }, { "include": "#catch-clause" }, { "include": "#finally-clause" }] }, "try-statement-with-optional-transition": { "patterns": [{ "include": "#try-block-with-optional-transition" }, { "include": "#catch-clause" }, { "include": "#finally-clause" }] }, "typeparam-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.razor.directive.typeparam" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(@)(typeparam)\\s+([^$]+)?", "name": "meta.directive" }, "unquoted-string-argument": { "match": "[^$]+", "name": "string.quoted.double.cs" }, "using-alias-directive": { "captures": { "1": { "name": "entity.name.type.alias.cs" }, "2": { "name": "keyword.operator.assignment.cs" }, "3": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "([_[:alpha:]][_[:alnum:]]*)\\b\\s*(=)\\s*(.+)\\s*" }, "using-directive": { "captures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.other.using.cs" }, "3": { "patterns": [{ "include": "#using-static-directive" }, { "include": "#using-alias-directive" }, { "include": "#using-standard-directive" }] }, "4": { "name": "keyword.control.razor.optionalSemicolon" } }, "match": "(@)(using)\\b\\s+(?!\\(|\\s)(.+?)?(;)?$", "name": "meta.directive" }, "using-standard-directive": { "captures": { "1": { "name": "entity.name.type.namespace.cs" } }, "match": "([_[:alpha:]][_[:alnum:]]*)\\s*" }, "using-statement": { "begin": "(?:(@))(using)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.other.using.cs" } }, "end": "(?<=})", "name": "meta.statement.using.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "using-statement-with-optional-transition": { "begin": "(?:^\\s*|(@))(using)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.other.using.cs" } }, "end": "(?<=})", "name": "meta.statement.using.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] }, "using-static-directive": { "captures": { "1": { "name": "keyword.other.static.cs" }, "2": { "patterns": [{ "include": "source.cs#type" }] } }, "match": "(static)\\b\\s+(.+)" }, "void-tag": { "begin": "(?i)(<)(!)?(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "constant.character.escape.razor.tagHelperOptOut" }, "3": { "name": "entity.name.tag.html" } }, "end": "/?>", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.structure.$3.void.html", "patterns": [{ "include": "text.html.basic#attribute" }] }, "wellformed-html": { "patterns": [{ "include": "#void-tag" }, { "include": "#non-void-tag" }] }, "while-statement": { "begin": "(?:(@)|^\\s*|(?<=})\\s*)(while)\\b\\s*(?=\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#transition" }] }, "2": { "name": "keyword.control.loop.while.cs" } }, "end": "(?<=})|(;)", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cs" } }, "name": "meta.statement.while.razor", "patterns": [{ "include": "#csharp-condition" }, { "include": "#csharp-code-block" }, { "include": "#razor-codeblock-body" }] } }, "scopeName": "text.aspnetcorerazor", "embeddedLangs": ["html", "csharp"] });
|
|
7
7
|
var razor = [
|
|
8
8
|
...html,
|
|
9
9
|
...csharp,
|
package/dist/langs/scala.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lang = Object.freeze({ "displayName": "Scala", "fileTypes": ["scala"], "firstLineMatch": "^#!/.*\\b\\w*scala\\b", "foldingStartMarker": "/\\*\\*|\\{\\s*$", "foldingStopMarker": "\\*\\*/|^\\s*\\}", "name": "scala", "patterns": [{ "include": "#code" }], "repository": { "backQuotedVariable": { "match": "`[^`]+`" }, "block-comments": { "patterns": [{ "captures": { "0": { "name": "punctuation.definition.comment.scala" } }, "match": "/\\*\\*/", "name": "comment.block.empty.scala" }, { "begin": "^\\s*(/\\*\\*)(?!/)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.scala" } }, "end": "\\*/", "endCaptures": { "0": { "name": "punctuation.definition.comment.scala" } }, "name": "comment.block.documentation.scala", "patterns": [{ "captures": { "1": { "name": "keyword.other.documentation.scaladoc.scala" }, "2": { "name": "variable.parameter.scala" } }, "match": "(@param)\\s+(\\S+)" }, { "captures": { "1": { "name": "keyword.other.documentation.scaladoc.scala" }, "2": { "name": "entity.name.class" } }, "match": "(@(?:tparam|throws))\\s+(\\S+)" }, { "match": "@(return|see|note|example|constructor|usecase|author|version|since|todo|deprecated|migration|define|inheritdoc)\\b", "name": "keyword.other.documentation.scaladoc.scala" }, { "captures": { "1": { "name": "punctuation.definition.documentation.link.scala" }, "2": { "name": "string.other.link.title.markdown" }, "3": { "name": "punctuation.definition.documentation.link.scala" } }, "match": "(\\[\\[)([^\\]]+)(\\]\\])" }, { "include": "#block-comments" }] }, { "begin": "/\\*", "captures": { "0": { "name": "punctuation.definition.comment.scala" } }, "end": "\\*/", "name": "comment.block.scala", "patterns": [{ "include": "#block-comments" }] }] }, "char-literal": { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.character.begin.scala" } }, "end": "'|$", "endCaptures": { "0": { "name": "punctuation.definition.character.end.scala" } }, "name": "string.quoted.other constant.character.literal.scala", "patterns": [{ "match": `\\\\(?:[btnfr\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})`, "name": "constant.character.escape.scala" }, { "match": "\\\\.", "name": "invalid.illegal.unrecognized-character-escape.scala" }, { "match": "[^']{2,}", "name": "invalid.illegal.character-literal-too-long" }, { "match": "(?<!')[^']", "name": "invalid.illegal.character-literal-too-long" }] }, "code": { "patterns": [{ "include": "#using-directive" }, { "include": "#script-header" }, { "include": "#storage-modifiers" }, { "include": "#declarations" }, { "include": "#inheritance" }, { "include": "#extension" }, { "include": "#imports" }, { "include": "#exports" }, { "include": "#comments" }, { "include": "#strings" }, { "include": "#initialization" }, { "include": "#xml-literal" }, { "include": "#keywords" }, { "include": "#using" }, { "include": "#constants" }, { "include": "#singleton-type" }, { "include": "#inline" }, { "include": "#scala-quoted-or-symbol" }, { "include": "#char-literal" }, { "include": "#empty-parentheses" }, { "include": "#parameter-list" }, { "include": "#qualifiedClassName" }, { "include": "#backQuotedVariable" }, { "include": "#curly-braces" }, { "include": "#meta-brackets" }, { "include": "#meta-bounds" }, { "include": "#meta-colons" }] }, "comments": { "patterns": [{ "include": "#block-comments" }, { "begin": "(^[ \\t]+)?(?=//)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.scala" } }, "end": "(?!\\G)", "patterns": [{ "begin": "//", "beginCaptures": { "0": { "name": "punctuation.definition.comment.scala" } }, "end": "\\n", "name": "comment.line.double-slash.scala" }] }] }, "constants": { "patterns": [{ "match": "\\b(false|null|true)\\b", "name": "constant.language.scala" }, { "match": "\\b(0[xX][0-9a-fA-F_]*)\\b", "name": "constant.numeric.scala" }, { "match": "\\b(([0-9][0-9_]*(\\.[0-9][0-9_]*)?)([eE](\\+|-)?[0-9][0-9_]*)?|[0-9][0-9_]*)[LlFfDd]?\\b", "name": "constant.numeric.scala" }, { "match": "(\\.[0-9][0-9_]*)([eE](\\+|-)?[0-9][0-9_]*)?[LlFfDd]?\\b", "name": "constant.numeric.scala" }, { "match": "\\b(this|super)\\b", "name": "variable.language.scala" }] }, "curly-braces": { "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.section.block.begin.scala" } }, "end": "\\}", "endCaptures": { "0": { "name": "punctuation.section.block.end.scala" } }, "patterns": [{ "include": "#code" }] }, "declarations": { "patterns": [{ "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "entity.name.function.declaration" } }, "match": "\\b(def)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?" }, { "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "entity.name.class.declaration" } }, "match": "\\b(trait)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?" }, { "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "keyword.declaration.scala" }, "3": { "name": "entity.name.class.declaration" } }, "match": "\\b(?:(case)\\s+)?(class|object|enum)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?" }, { "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "entity.name.type.declaration" } }, "match": "(?<!\\.)\\b(type)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?" }, { "captures": { "1": { "name": "keyword.declaration.stable.scala" }, "2": { "name": "keyword.declaration.volatile.scala" } }, "match": "\\b(?:(val)|(var))\\b\\s*(?!//|/\\*)(?=(?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)?\\()" }, { "captures": { "1": { "name": "keyword.declaration.stable.scala" }, "2": { "name": "variable.stable.declaration.scala" } }, "match": "\\b(val)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)(?:\\s*,\\s*(?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))*)?" }, { "captures": { "1": { "name": "keyword.declaration.volatile.scala" }, "2": { "name": "variable.volatile.declaration.scala" } }, "match": "\\b(var)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)(?:\\s*,\\s*(?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))*)?" }, { "captures": { "1": { "name": "keyword.other.scoping.scala" }, "2": { "name": "keyword.declaration.scala" }, "3": { "name": "entity.name.class.declaration" } }, "match": "\\b(package)\\s+(object)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?" }, { "begin": "\\b(package)\\s+", "beginCaptures": { "1": { "name": "keyword.other.import.scala" } }, "end": "(?<=[\\n;])", "name": "meta.package.scala", "patterns": [{ "include": "#comments" }, { "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))", "name": "entity.name.package.scala" }, { "match": "\\.", "name": "punctuation.definition.package" }] }, { "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "entity.name.given.declaration" } }, "match": "\\b(given)\\b\\s*([_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|`[^`]+`)?" }] }, "empty-parentheses": { "captures": { "1": { "name": "meta.bracket.scala" } }, "match": "(\\(\\))", "name": "meta.parentheses.scala" }, "exports": { "begin": "\\b(export)\\s+", "beginCaptures": { "1": { "name": "keyword.other.export.scala" } }, "end": "(?<=[\\n;])", "name": "meta.export.scala", "patterns": [{ "include": "#comments" }, { "match": "\\b(given)\\b", "name": "keyword.other.export.given.scala" }, { "match": "[A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?", "name": "entity.name.class.export.scala" }, { "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))", "name": "entity.name.export.scala" }, { "match": "\\.", "name": "punctuation.definition.export" }, { "begin": "{", "beginCaptures": { "0": { "name": "meta.bracket.scala" } }, "end": "}", "endCaptures": { "0": { "name": "meta.bracket.scala" } }, "name": "meta.export.selector.scala", "patterns": [{ "captures": { "1": { "name": "keyword.other.export.given.scala" }, "2": { "name": "entity.name.class.export.renamed-from.scala" }, "3": { "name": "entity.name.export.renamed-from.scala" }, "4": { "name": "keyword.other.arrow.scala" }, "5": { "name": "entity.name.class.export.renamed-to.scala" }, "6": { "name": "entity.name.export.renamed-to.scala" } }, "match": "(?x)(given\\s)?\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*(=>)\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*" }, { "match": "\\b(given)\\b", "name": "keyword.other.export.given.scala" }, { "captures": { "1": { "name": "keyword.other.export.given.scala" }, "2": { "name": "entity.name.class.export.scala" }, "3": { "name": "entity.name.export.scala" } }, "match": "(given\\s+)?(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))" }] }] }, "extension": { "patterns": [{ "captures": { "1": { "name": "keyword.declaration.scala" } }, "match": "^\\s*(extension)\\s+(?=[\\[\\(])" }] }, "imports": { "begin": "\\b(import)\\s+", "beginCaptures": { "1": { "name": "keyword.other.import.scala" } }, "end": "(?<=[\\n;])", "name": "meta.import.scala", "patterns": [{ "include": "#comments" }, { "match": "\\b(given)\\b", "name": "keyword.other.import.given.scala" }, { "match": "[A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?", "name": "entity.name.class.import.scala" }, { "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))", "name": "entity.name.import.scala" }, { "match": "\\.", "name": "punctuation.definition.import" }, { "begin": "{", "beginCaptures": { "0": { "name": "meta.bracket.scala" } }, "end": "}", "endCaptures": { "0": { "name": "meta.bracket.scala" } }, "name": "meta.import.selector.scala", "patterns": [{ "captures": { "1": { "name": "keyword.other.import.given.scala" }, "2": { "name": "entity.name.class.import.renamed-from.scala" }, "3": { "name": "entity.name.import.renamed-from.scala" }, "4": { "name": "keyword.other.arrow.scala" }, "5": { "name": "entity.name.class.import.renamed-to.scala" }, "6": { "name": "entity.name.import.renamed-to.scala" } }, "match": "(?x)(given\\s)?\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*(=>)\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*" }, { "match": "\\b(given)\\b", "name": "keyword.other.import.given.scala" }, { "captures": { "1": { "name": "keyword.other.import.given.scala" }, "2": { "name": "entity.name.class.import.scala" }, "3": { "name": "entity.name.import.scala" } }, "match": "(given\\s+)?(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))" }] }] }, "inheritance": { "patterns": [{ "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "entity.name.class" } }, "match": '\\b(extends|with|derives)\\b\\s*([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|`[^`]+`|(?=\\([^\\)]+=>)|(?=(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))|(?="))?' }] }, "initialization": { "captures": { "1": { "name": "keyword.declaration.scala" } }, "match": "\\b(new)\\b" }, "inline": { "patterns": [{ "match": "\\b(inline)(?=\\s+((?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)\\s*:)", "name": "storage.modifier.other" }, { "match": "\\b(inline)\\b(?=(?:.(?!\\b(?:val|def|given)\\b))*\\b(if|match)\\b)", "name": "keyword.control.flow.scala" }] }, "keywords": { "patterns": [{ "match": "\\b(return|throw)\\b", "name": "keyword.control.flow.jump.scala" }, { "match": "\\b(classOf|isInstanceOf|asInstanceOf)\\b", "name": "support.function.type-of.scala" }, { "match": "\\b(else|if|then|do|while|for|yield|match|case)\\b", "name": "keyword.control.flow.scala" }, { "match": "^\\s*(end)\\s+(if|while|for|match)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)", "name": "keyword.control.flow.end.scala" }, { "match": "^\\s*(end)\\s+(val)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)", "name": "keyword.declaration.stable.end.scala" }, { "match": "^\\s*(end)\\s+(var)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)", "name": "keyword.declaration.volatile.end.scala" }, { "captures": { "1": { "name": "keyword.declaration.end.scala" }, "2": { "name": "keyword.declaration.end.scala" }, "3": { "name": "entity.name.type.declaration" } }, "match": "^\\s*(end)\\s+(?:(new|extension)|([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?))(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)" }, { "match": "\\b(catch|finally|try)\\b", "name": "keyword.control.exception.scala" }, { "match": "^\\s*(end)\\s+(try)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)", "name": "keyword.control.exception.end.scala" }, { "captures": { "1": { "name": "keyword.declaration.end.scala" }, "2": { "name": "entity.name.declaration" } }, "match": "^\\s*(end)\\s+(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))?(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)" }, { "match": "(==?|!=|<=|>=|<>|<|>)", "name": "keyword.operator.comparison.scala" }, { "match": "(\\-|\\+|\\*|/(?![/*])|%|~)", "name": "keyword.operator.arithmetic.scala" }, { "match": "(?<![!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]|_)(!|&&|\\|\\|)(?![!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}])", "name": "keyword.operator.logical.scala" }, { "match": "(<-|\u2190|->|\u2192|=>|\u21D2|\\?|\\:+|@|\\|)+", "name": "keyword.operator.scala" }] }, "meta-bounds": { "comment": "For themes: Matching view bounds", "match": "<%|=:=|<:<|<%<|>:|<:", "name": "meta.bounds.scala" }, "meta-brackets": { "comment": "For themes: Brackets look nice when colored.", "patterns": [{ "comment": "The punctuation.section.*.begin is needed for return snippet in source bundle", "match": "\\{", "name": "punctuation.section.block.begin.scala" }, { "comment": "The punctuation.section.*.end is needed for return snippet in source bundle", "match": "\\}", "name": "punctuation.section.block.end.scala" }, { "match": "{|}|\\(|\\)|\\[|\\]", "name": "meta.bracket.scala" }] }, "meta-colons": { "comment": "For themes: Matching type colons", "patterns": [{ "match": "(?<!:):(?!:)", "name": "meta.colon.scala" }] }, "parameter-list": { "patterns": [{ "captures": { "1": { "name": "variable.parameter.scala" }, "2": { "name": "meta.colon.scala" } }, "match": "(?<=[^\\._$a-zA-Z0-9])(`[^`]+`|[_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)\\s*(:)\\s+" }] }, "qualifiedClassName": { "captures": { "1": { "name": "entity.name.class" } }, "match": "(\\b([A-Z][\\w]*)(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)" }, "scala-quoted-or-symbol": { "patterns": [{ "captures": { "1": { "name": "keyword.control.flow.staging.scala constant.other.symbol.scala" }, "2": { "name": "constant.other.symbol.scala" } }, "match": "(')((?>(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))(?!')" }, { "match": "'(?=\\s*\\{(?!'))", "name": "keyword.control.flow.staging.scala" }, { "match": "'(?=\\s*\\[(?!'))", "name": "keyword.control.flow.staging.scala" }, { "match": "\\$(?=\\s*\\{)", "name": "keyword.control.flow.staging.scala" }] }, "script-header": { "captures": { "1": { "name": "string.unquoted.shebang.scala" } }, "match": "^#!(.*)$", "name": "comment.block.shebang.scala" }, "singleton-type": { "captures": { "1": { "name": "keyword.type.scala" } }, "match": "\\.(type)(?![A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[0-9])" }, "storage-modifiers": { "patterns": [{ "match": "\\b(private\\[\\S+\\]|protected\\[\\S+\\]|private|protected)\\b", "name": "storage.modifier.access" }, { "match": "\\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|override|@transient|@native)\\b", "name": "storage.modifier.other" }, { "match": "(?<=^|\\s)\\b(transparent|opaque|infix|open|inline)\\b(?=[a-z\\s]*\\b(def|val|var|given|type|class|trait|object|enum)\\b)", "name": "storage.modifier.other" }] }, "string-interpolation": { "patterns": [{ "match": "\\$\\$", "name": "constant.character.escape.interpolation.scala" }, { "captures": { "1": { "name": "punctuation.definition.template-expression.begin.scala" } }, "match": "(\\$)([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\p{Lo}\\p{Nl}\\p{Ll}0-9]*)", "name": "meta.template.expression.scala" }, { "begin": "\\$\\{", "beginCaptures": { "0": { "name": "punctuation.definition.template-expression.begin.scala" } }, "contentName": "meta.embedded.line.scala", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.template-expression.end.scala" } }, "name": "meta.template.expression.scala", "patterns": [{ "include": "#code" }] }] }, "strings": { "patterns": [{ "begin": '"""', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.scala" } }, "end": '"""(?!")', "endCaptures": { "0": { "name": "punctuation.definition.string.end.scala" } }, "name": "string.quoted.triple.scala", "patterns": [{ "match": "\\\\\\\\|\\\\u[0-9A-Fa-f]{4}", "name": "constant.character.escape.scala" }] }, { "begin": '\\b(raw)(""")', "beginCaptures": { "1": { "name": "keyword.interpolation.scala" }, "2": { "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.begin.scala" } }, "end": '(""")(?!")|\\$\n|(\\$[^\\$"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])', "endCaptures": { "1": { "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.end.scala" }, "2": { "name": "invalid.illegal.unrecognized-string-escape.scala" } }, "patterns": [{ "match": '\\$[\\$"]', "name": "constant.character.escape.scala" }, { "include": "#string-interpolation" }, { "match": ".", "name": "string.quoted.triple.interpolated.scala" }] }, { "begin": '\\b((?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?))(""")', "beginCaptures": { "1": { "name": "keyword.interpolation.scala" }, "2": { "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.begin.scala" } }, "end": '(""")(?!")|\\$\n|(\\$[^\\$"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])', "endCaptures": { "1": { "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.end.scala" }, "2": { "name": "invalid.illegal.unrecognized-string-escape.scala" } }, "patterns": [{ "include": "#string-interpolation" }, { "match": "\\\\\\\\|\\\\u[0-9A-Fa-f]{4}", "name": "constant.character.escape.scala" }, { "match": ".", "name": "string.quoted.triple.interpolated.scala" }] }, { "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.scala" } }, "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.scala" } }, "name": "string.quoted.double.scala", "patterns": [{ "match": `\\\\(?:[btnfr\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})`, "name": "constant.character.escape.scala" }, { "match": "\\\\.", "name": "invalid.illegal.unrecognized-string-escape.scala" }] }, { "begin": '\\b(raw)(")', "beginCaptures": { "1": { "name": "keyword.interpolation.scala" }, "2": { "name": "string.quoted.double.interpolated.scala punctuation.definition.string.begin.scala" } }, "end": '(")|\\$\n|(\\$[^\\$"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])', "endCaptures": { "1": { "name": "string.quoted.double.interpolated.scala punctuation.definition.string.end.scala" }, "2": { "name": "invalid.illegal.unrecognized-string-escape.scala" } }, "patterns": [{ "match": '\\$[\\$"]', "name": "constant.character.escape.scala" }, { "include": "#string-interpolation" }, { "match": ".", "name": "string.quoted.double.interpolated.scala" }] }, { "begin": '\\b((?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?))(")', "beginCaptures": { "1": { "name": "keyword.interpolation.scala" }, "2": { "name": "string.quoted.double.interpolated.scala punctuation.definition.string.begin.scala" } }, "end": '(")|\\$\n|(\\$[^\\$"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])', "endCaptures": { "1": { "name": "string.quoted.double.interpolated.scala punctuation.definition.string.end.scala" }, "2": { "name": "invalid.illegal.unrecognized-string-escape.scala" } }, "patterns": [{ "match": '\\$[\\$"]', "name": "constant.character.escape.scala" }, { "include": "#string-interpolation" }, { "match": `\\\\(?:[btnfr\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})`, "name": "constant.character.escape.scala" }, { "match": "\\\\.", "name": "invalid.illegal.unrecognized-string-escape.scala" }, { "match": ".", "name": "string.quoted.double.interpolated.scala" }] }] }, "using": { "patterns": [{ "captures": { "1": { "name": "keyword.declaration.scala" } }, "match": "(?<=\\()\\s*(using)\\s" }] }, "using-directive": { "begin": "^\\s*(//>)\\s*(using)[^\\S\\n]+(?:(\\S+))?", "beginCaptures": { "1": { "name": "punctuation.definition.comment.scala" }, "2": { "name": "keyword.other.import.scala" }, "3": { "patterns": [{ "match": "[A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)", "name": "entity.name.import.scala" }, { "match": "\\.", "name": "punctuation.definition.import" }] } }, "end": "\\n", "name": "comment.line.shebang.scala", "patterns": [{ "include": "#constants" }, { "include": "#strings" }, { "match": "[^\\s,]+", "name": "string.quoted.double.scala" }] }, "xml-doublequotedString": { "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.xml" } }, "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.xml" } }, "name": "string.quoted.double.xml", "patterns": [{ "include": "#xml-entity" }] }, "xml-embedded-content": { "patterns": [{ "begin": "{", "captures": { "0": { "name": "meta.bracket.scala" } }, "end": "}", "name": "meta.source.embedded.scala", "patterns": [{ "include": "#code" }] }, { "captures": { "1": { "name": "entity.other.attribute-name.namespace.xml" }, "2": { "name": "entity.other.attribute-name.xml" }, "3": { "name": "punctuation.separator.namespace.xml" }, "4": { "name": "entity.other.attribute-name.localname.xml" } }, "match": " (?:([-_a-zA-Z0-9]+)((:)))?([_a-zA-Z-]+)=" }, { "include": "#xml-doublequotedString" }, { "include": "#xml-singlequotedString" }] }, "xml-entity": { "captures": { "1": { "name": "punctuation.definition.constant.xml" }, "3": { "name": "punctuation.definition.constant.xml" } }, "match": "(&)([:a-zA-Z_][:a-zA-Z0-9_.-]*|#[0-9]+|#x[0-9a-fA-F]+)(;)", "name": "constant.character.entity.xml" }, "xml-literal": { "patterns": [{ "begin": "(<)((?:([_a-zA-Z0-9][_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*))(?=(\\s[^>]*)?></\\2>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.xml" }, "3": { "name": "entity.name.tag.namespace.xml" }, "4": { "name": "entity.name.tag.xml" }, "5": { "name": "punctuation.separator.namespace.xml" }, "6": { "name": "entity.name.tag.localname.xml" } }, "comment": "We do not allow a tag name to start with a - since this would likely conflict with the <- operator. This is not very common for tag names anyway. Also code such as -- if (val <val2 || val> val3) will falsly be recognized as an xml tag. The solution is to put a space on either side of the comparison operator", "end": "(>(<))/(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]*[_a-zA-Z0-9])(>)", "endCaptures": { "1": { "name": "punctuation.definition.tag.xml" }, "2": { "name": "meta.scope.between-tag-pair.xml" }, "3": { "name": "entity.name.tag.namespace.xml" }, "4": { "name": "entity.name.tag.xml" }, "5": { "name": "punctuation.separator.namespace.xml" }, "6": { "name": "entity.name.tag.localname.xml" }, "7": { "name": "punctuation.definition.tag.xml" } }, "name": "meta.tag.no-content.xml", "patterns": [{ "include": "#xml-embedded-content" }] }, { "begin": "(</?)(?:([_a-zA-Z0-9][-_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*)(?=[^>]*?>)", "captures": { "1": { "name": "punctuation.definition.tag.xml" }, "2": { "name": "entity.name.tag.namespace.xml" }, "3": { "name": "entity.name.tag.xml" }, "4": { "name": "punctuation.separator.namespace.xml" }, "5": { "name": "entity.name.tag.localname.xml" } }, "end": "(/?>)", "name": "meta.tag.xml", "patterns": [{ "include": "#xml-embedded-content" }] }, { "include": "#xml-entity" }] }, "xml-singlequotedString": { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.xml" } }, "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.xml" } }, "name": "string.quoted.single.xml", "patterns": [{ "include": "#xml-entity" }] } }, "scopeName": "source.scala" });
|
|
1
|
+
const lang = Object.freeze({ "displayName": "Scala", "fileTypes": ["scala"], "firstLineMatch": "^#!/.*\\b\\w*scala\\b", "foldingStartMarker": "/\\*\\*|\\{\\s*$", "foldingStopMarker": "\\*\\*/|^\\s*\\}", "name": "scala", "patterns": [{ "include": "#code" }], "repository": { "backQuotedVariable": { "match": "`[^`]+`" }, "block-comments": { "patterns": [{ "captures": { "0": { "name": "punctuation.definition.comment.scala" } }, "match": "/\\*\\*/", "name": "comment.block.empty.scala" }, { "begin": "^\\s*(/\\*\\*)(?!/)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.scala" } }, "end": "\\*/", "endCaptures": { "0": { "name": "punctuation.definition.comment.scala" } }, "name": "comment.block.documentation.scala", "patterns": [{ "captures": { "1": { "name": "keyword.other.documentation.scaladoc.scala" }, "2": { "name": "variable.parameter.scala" } }, "match": "(@param)\\s+(\\S+)" }, { "captures": { "1": { "name": "keyword.other.documentation.scaladoc.scala" }, "2": { "name": "entity.name.class" } }, "match": "(@(?:tparam|throws))\\s+(\\S+)" }, { "match": "@(return|see|note|example|constructor|usecase|author|version|since|todo|deprecated|migration|define|inheritdoc)\\b", "name": "keyword.other.documentation.scaladoc.scala" }, { "captures": { "1": { "name": "punctuation.definition.documentation.link.scala" }, "2": { "name": "string.other.link.title.markdown" }, "3": { "name": "punctuation.definition.documentation.link.scala" } }, "match": "(\\[\\[)([^\\]]+)(\\]\\])" }, { "include": "#block-comments" }] }, { "begin": "/\\*", "captures": { "0": { "name": "punctuation.definition.comment.scala" } }, "end": "\\*/", "name": "comment.block.scala", "patterns": [{ "include": "#block-comments" }] }] }, "char-literal": { "patterns": [{ "captures": { "1": { "name": "punctuation.definition.character.begin.scala" }, "2": { "name": "punctuation.definition.character.end.scala" } }, "match": "(')'(')", "name": "string.quoted.other constant.character.literal.scala" }, { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.character.begin.scala" } }, "end": "'|$", "endCaptures": { "0": { "name": "punctuation.definition.character.end.scala" } }, "name": "string.quoted.other constant.character.literal.scala", "patterns": [{ "match": `\\\\(?:[btnfr\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})`, "name": "constant.character.escape.scala" }, { "match": "\\\\.", "name": "invalid.illegal.unrecognized-character-escape.scala" }, { "match": "[^']{2,}", "name": "invalid.illegal.character-literal-too-long" }, { "match": "(?<!')[^']", "name": "invalid.illegal.character-literal-too-long" }] }] }, "code": { "patterns": [{ "include": "#using-directive" }, { "include": "#script-header" }, { "include": "#storage-modifiers" }, { "include": "#declarations" }, { "include": "#inheritance" }, { "include": "#extension" }, { "include": "#imports" }, { "include": "#exports" }, { "include": "#comments" }, { "include": "#strings" }, { "include": "#initialization" }, { "include": "#xml-literal" }, { "include": "#keywords" }, { "include": "#using" }, { "include": "#constants" }, { "include": "#singleton-type" }, { "include": "#inline" }, { "include": "#scala-quoted-or-symbol" }, { "include": "#char-literal" }, { "include": "#empty-parentheses" }, { "include": "#parameter-list" }, { "include": "#qualifiedClassName" }, { "include": "#backQuotedVariable" }, { "include": "#curly-braces" }, { "include": "#meta-brackets" }, { "include": "#meta-bounds" }, { "include": "#meta-colons" }] }, "comments": { "patterns": [{ "include": "#block-comments" }, { "begin": "(^[ \\t]+)?(?=//)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.scala" } }, "end": "(?!\\G)", "patterns": [{ "begin": "//", "beginCaptures": { "0": { "name": "punctuation.definition.comment.scala" } }, "end": "\\n", "name": "comment.line.double-slash.scala" }] }] }, "constants": { "patterns": [{ "match": "\\b(false|null|true)\\b", "name": "constant.language.scala" }, { "match": "\\b(0[xX][0-9a-fA-F_]*)\\b", "name": "constant.numeric.scala" }, { "match": "\\b(([0-9][0-9_]*(\\.[0-9][0-9_]*)?)([eE](\\+|-)?[0-9][0-9_]*)?|[0-9][0-9_]*)[LlFfDd]?\\b", "name": "constant.numeric.scala" }, { "match": "(\\.[0-9][0-9_]*)([eE](\\+|-)?[0-9][0-9_]*)?[LlFfDd]?\\b", "name": "constant.numeric.scala" }, { "match": "\\b(this|super)\\b", "name": "variable.language.scala" }] }, "curly-braces": { "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.section.block.begin.scala" } }, "end": "\\}", "endCaptures": { "0": { "name": "punctuation.section.block.end.scala" } }, "patterns": [{ "include": "#code" }] }, "declarations": { "patterns": [{ "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "entity.name.function.declaration" } }, "match": "\\b(def)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?" }, { "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "entity.name.class.declaration" } }, "match": "\\b(trait)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?" }, { "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "keyword.declaration.scala" }, "3": { "name": "entity.name.class.declaration" } }, "match": "\\b(?:(case)\\s+)?(class|object|enum)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?" }, { "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "entity.name.type.declaration" } }, "match": "(?<!\\.)\\b(type)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?" }, { "captures": { "1": { "name": "keyword.declaration.stable.scala" }, "2": { "name": "keyword.declaration.volatile.scala" } }, "match": "\\b(?:(val)|(var))\\b\\s*(?!//|/\\*)(?=(?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)?\\()" }, { "captures": { "1": { "name": "keyword.declaration.stable.scala" }, "2": { "name": "variable.stable.declaration.scala" } }, "match": '\\b(val)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)(?:\\s*,\\s*(?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))*)?(?!")' }, { "captures": { "1": { "name": "keyword.declaration.volatile.scala" }, "2": { "name": "variable.volatile.declaration.scala" } }, "match": '\\b(var)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)(?:\\s*,\\s*(?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))*)?(?!")' }, { "captures": { "1": { "name": "keyword.other.package.scala" }, "2": { "name": "keyword.declaration.scala" }, "3": { "name": "entity.name.class.declaration" } }, "match": "\\b(package)\\s+(object)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?" }, { "begin": "\\b(package)\\s+", "beginCaptures": { "1": { "name": "keyword.other.package.scala" } }, "end": "(?<=[\\n;])", "name": "meta.package.scala", "patterns": [{ "include": "#comments" }, { "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))", "name": "entity.name.package.scala" }, { "match": "\\.", "name": "punctuation.definition.package" }] }, { "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "entity.name.given.declaration" } }, "match": "\\b(given)\\b\\s*([_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|`[^`]+`)?" }] }, "empty-parentheses": { "captures": { "1": { "name": "meta.bracket.scala" } }, "match": "(\\(\\))", "name": "meta.parentheses.scala" }, "exports": { "begin": "\\b(export)\\s+", "beginCaptures": { "1": { "name": "keyword.other.export.scala" } }, "end": "(?<=[\\n;])", "name": "meta.export.scala", "patterns": [{ "include": "#comments" }, { "match": "\\b(given)\\b", "name": "keyword.other.export.given.scala" }, { "match": "[A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?", "name": "entity.name.class.export.scala" }, { "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))", "name": "entity.name.export.scala" }, { "match": "\\.", "name": "punctuation.definition.export" }, { "begin": "{", "beginCaptures": { "0": { "name": "meta.bracket.scala" } }, "end": "}", "endCaptures": { "0": { "name": "meta.bracket.scala" } }, "name": "meta.export.selector.scala", "patterns": [{ "captures": { "1": { "name": "keyword.other.export.given.scala" }, "2": { "name": "entity.name.class.export.renamed-from.scala" }, "3": { "name": "entity.name.export.renamed-from.scala" }, "4": { "name": "keyword.other.arrow.scala" }, "5": { "name": "entity.name.class.export.renamed-to.scala" }, "6": { "name": "entity.name.export.renamed-to.scala" } }, "match": "(?x)(given\\s)?\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*(=>)\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*" }, { "match": "\\b(given)\\b", "name": "keyword.other.export.given.scala" }, { "captures": { "1": { "name": "keyword.other.export.given.scala" }, "2": { "name": "entity.name.class.export.scala" }, "3": { "name": "entity.name.export.scala" } }, "match": "(given\\s+)?(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))" }] }] }, "extension": { "patterns": [{ "captures": { "1": { "name": "keyword.declaration.scala" } }, "match": "^\\s*(extension)\\s+(?=[\\[\\(])" }] }, "imports": { "begin": "\\b(import)\\s+", "beginCaptures": { "1": { "name": "keyword.other.import.scala" } }, "end": "(?<=[\\n;])", "name": "meta.import.scala", "patterns": [{ "include": "#comments" }, { "match": "\\b(given)\\b", "name": "keyword.other.import.given.scala" }, { "match": "[A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?", "name": "entity.name.class.import.scala" }, { "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))", "name": "entity.name.import.scala" }, { "match": "\\.", "name": "punctuation.definition.import" }, { "begin": "{", "beginCaptures": { "0": { "name": "meta.bracket.scala" } }, "end": "}", "endCaptures": { "0": { "name": "meta.bracket.scala" } }, "name": "meta.import.selector.scala", "patterns": [{ "captures": { "1": { "name": "keyword.other.import.given.scala" }, "2": { "name": "entity.name.class.import.renamed-from.scala" }, "3": { "name": "entity.name.import.renamed-from.scala" }, "4": { "name": "keyword.other.arrow.scala" }, "5": { "name": "entity.name.class.import.renamed-to.scala" }, "6": { "name": "entity.name.import.renamed-to.scala" } }, "match": "(?x)(given\\s)?\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*(=>)\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*" }, { "match": "\\b(given)\\b", "name": "keyword.other.import.given.scala" }, { "captures": { "1": { "name": "keyword.other.import.given.scala" }, "2": { "name": "entity.name.class.import.scala" }, "3": { "name": "entity.name.import.scala" } }, "match": "(given\\s+)?(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))" }] }] }, "inheritance": { "patterns": [{ "captures": { "1": { "name": "keyword.declaration.scala" }, "2": { "name": "entity.name.class" } }, "match": '\\b(extends|with|derives)\\b\\s*([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|`[^`]+`|(?=\\([^\\)]+=>)|(?=(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))|(?="))?' }] }, "initialization": { "captures": { "1": { "name": "keyword.declaration.scala" } }, "match": "\\b(new)\\b" }, "inline": { "patterns": [{ "match": "\\b(inline)(?=\\s+((?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)\\s*:)", "name": "storage.modifier.other" }, { "match": "\\b(inline)\\b(?=(?:.(?!\\b(?:val|def|given)\\b))*\\b(if|match)\\b)", "name": "keyword.control.flow.scala" }] }, "keywords": { "patterns": [{ "match": "\\b(return|throw)\\b", "name": "keyword.control.flow.jump.scala" }, { "match": "\\b(classOf|isInstanceOf|asInstanceOf)\\b", "name": "support.function.type-of.scala" }, { "match": "\\b(else|if|then|do|while|for|yield|match|case)\\b", "name": "keyword.control.flow.scala" }, { "match": "^\\s*(end)\\s+(if|while|for|match)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)", "name": "keyword.control.flow.end.scala" }, { "match": "^\\s*(end)\\s+(val)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)", "name": "keyword.declaration.stable.end.scala" }, { "match": "^\\s*(end)\\s+(var)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)", "name": "keyword.declaration.volatile.end.scala" }, { "captures": { "1": { "name": "keyword.declaration.end.scala" }, "2": { "name": "keyword.declaration.end.scala" }, "3": { "name": "entity.name.type.declaration" } }, "match": "^\\s*(end)\\s+(?:(new|extension)|([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?))(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)" }, { "match": "\\b(catch|finally|try)\\b", "name": "keyword.control.exception.scala" }, { "match": "^\\s*(end)\\s+(try)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)", "name": "keyword.control.exception.end.scala" }, { "captures": { "1": { "name": "keyword.declaration.end.scala" }, "2": { "name": "entity.name.declaration" } }, "match": "^\\s*(end)\\s+(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))?(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)" }, { "match": "(==?|!=|<=|>=|<>|<|>)", "name": "keyword.operator.comparison.scala" }, { "match": "(\\-|\\+|\\*|/(?![/*])|%|~)", "name": "keyword.operator.arithmetic.scala" }, { "match": "(?<![!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]|_)(!|&&|\\|\\|)(?![!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}])", "name": "keyword.operator.logical.scala" }, { "match": "(<-|\u2190|->|\u2192|=>|\u21D2|\\?|\\:+|@|\\|)+", "name": "keyword.operator.scala" }] }, "meta-bounds": { "comment": "For themes: Matching view bounds", "match": "<%|=:=|<:<|<%<|>:|<:", "name": "meta.bounds.scala" }, "meta-brackets": { "comment": "For themes: Brackets look nice when colored.", "patterns": [{ "comment": "The punctuation.section.*.begin is needed for return snippet in source bundle", "match": "\\{", "name": "punctuation.section.block.begin.scala" }, { "comment": "The punctuation.section.*.end is needed for return snippet in source bundle", "match": "\\}", "name": "punctuation.section.block.end.scala" }, { "match": "{|}|\\(|\\)|\\[|\\]", "name": "meta.bracket.scala" }] }, "meta-colons": { "comment": "For themes: Matching type colons", "patterns": [{ "match": "(?<!:):(?!:)", "name": "meta.colon.scala" }] }, "parameter-list": { "patterns": [{ "captures": { "1": { "name": "variable.parameter.scala" }, "2": { "name": "meta.colon.scala" } }, "match": "(?<=[^\\._$a-zA-Z0-9])(`[^`]+`|[_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)\\s*(:)\\s+" }] }, "qualifiedClassName": { "captures": { "1": { "name": "entity.name.class" } }, "match": "(\\b([A-Z][\\w]*)(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)" }, "scala-quoted-or-symbol": { "patterns": [{ "captures": { "1": { "name": "keyword.control.flow.staging.scala constant.other.symbol.scala" }, "2": { "name": "constant.other.symbol.scala" } }, "match": "(')((?>(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))(?!')" }, { "match": "'(?=\\s*\\{(?!'))", "name": "keyword.control.flow.staging.scala" }, { "match": "'(?=\\s*\\[(?!'))", "name": "keyword.control.flow.staging.scala" }, { "match": "\\$(?=\\s*\\{)", "name": "keyword.control.flow.staging.scala" }] }, "script-header": { "captures": { "1": { "name": "string.unquoted.shebang.scala" } }, "match": "^#!(.*)$", "name": "comment.block.shebang.scala" }, "singleton-type": { "captures": { "1": { "name": "keyword.type.scala" } }, "match": "\\.(type)(?![A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[0-9])" }, "storage-modifiers": { "patterns": [{ "match": "\\b(private\\[\\S+\\]|protected\\[\\S+\\]|private|protected)\\b", "name": "storage.modifier.access" }, { "match": "\\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|override|@transient|@native)\\b", "name": "storage.modifier.other" }, { "match": "(?<=^|\\s)\\b(transparent|opaque|infix|open|inline)\\b(?=[a-z\\s]*\\b(def|val|var|given|type|class|trait|object|enum)\\b)", "name": "storage.modifier.other" }] }, "string-interpolation": { "patterns": [{ "match": "\\$\\$", "name": "constant.character.escape.interpolation.scala" }, { "captures": { "1": { "name": "punctuation.definition.template-expression.begin.scala" } }, "match": "(\\$)([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\p{Lo}\\p{Nl}\\p{Ll}0-9]*)", "name": "meta.template.expression.scala" }, { "begin": "\\$\\{", "beginCaptures": { "0": { "name": "punctuation.definition.template-expression.begin.scala" } }, "contentName": "meta.embedded.line.scala", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.template-expression.end.scala" } }, "name": "meta.template.expression.scala", "patterns": [{ "include": "#code" }] }] }, "strings": { "patterns": [{ "begin": '"""', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.scala" } }, "end": '"""(?!")', "endCaptures": { "0": { "name": "punctuation.definition.string.end.scala" } }, "name": "string.quoted.triple.scala", "patterns": [{ "match": "\\\\\\\\|\\\\u[0-9A-Fa-f]{4}", "name": "constant.character.escape.scala" }] }, { "begin": '\\b(raw)(""")', "beginCaptures": { "1": { "name": "keyword.interpolation.scala" }, "2": { "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.begin.scala" } }, "end": '(""")(?!")|\\$\n|(\\$[^\\$"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])', "endCaptures": { "1": { "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.end.scala" }, "2": { "name": "invalid.illegal.unrecognized-string-escape.scala" } }, "patterns": [{ "match": '\\$[\\$"]', "name": "constant.character.escape.scala" }, { "include": "#string-interpolation" }, { "match": ".", "name": "string.quoted.triple.interpolated.scala" }] }, { "begin": '\\b((?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?))(""")', "beginCaptures": { "1": { "name": "keyword.interpolation.scala" }, "2": { "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.begin.scala" } }, "end": '(""")(?!")|\\$\n|(\\$[^\\$"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])', "endCaptures": { "1": { "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.end.scala" }, "2": { "name": "invalid.illegal.unrecognized-string-escape.scala" } }, "patterns": [{ "include": "#string-interpolation" }, { "match": "\\\\\\\\|\\\\u[0-9A-Fa-f]{4}", "name": "constant.character.escape.scala" }, { "match": ".", "name": "string.quoted.triple.interpolated.scala" }] }, { "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.scala" } }, "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.scala" } }, "name": "string.quoted.double.scala", "patterns": [{ "match": `\\\\(?:[btnfr\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})`, "name": "constant.character.escape.scala" }, { "match": "\\\\.", "name": "invalid.illegal.unrecognized-string-escape.scala" }] }, { "begin": '\\b(raw)(")', "beginCaptures": { "1": { "name": "keyword.interpolation.scala" }, "2": { "name": "string.quoted.double.interpolated.scala punctuation.definition.string.begin.scala" } }, "end": '(")|\\$\n|(\\$[^\\$"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])', "endCaptures": { "1": { "name": "string.quoted.double.interpolated.scala punctuation.definition.string.end.scala" }, "2": { "name": "invalid.illegal.unrecognized-string-escape.scala" } }, "patterns": [{ "match": '\\$[\\$"]', "name": "constant.character.escape.scala" }, { "include": "#string-interpolation" }, { "match": ".", "name": "string.quoted.double.interpolated.scala" }] }, { "begin": '\\b((?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?))(")', "beginCaptures": { "1": { "name": "keyword.interpolation.scala" }, "2": { "name": "string.quoted.double.interpolated.scala punctuation.definition.string.begin.scala" } }, "end": '(")|\\$\n|(\\$[^\\$"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])', "endCaptures": { "1": { "name": "string.quoted.double.interpolated.scala punctuation.definition.string.end.scala" }, "2": { "name": "invalid.illegal.unrecognized-string-escape.scala" } }, "patterns": [{ "match": '\\$[\\$"]', "name": "constant.character.escape.scala" }, { "include": "#string-interpolation" }, { "match": `\\\\(?:[btnfr\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})`, "name": "constant.character.escape.scala" }, { "match": "\\\\.", "name": "invalid.illegal.unrecognized-string-escape.scala" }, { "match": ".", "name": "string.quoted.double.interpolated.scala" }] }] }, "using": { "patterns": [{ "captures": { "1": { "name": "keyword.declaration.scala" } }, "match": "(?<=\\()\\s*(using)\\s" }] }, "using-directive": { "begin": "^\\s*(//>)\\s*(using)[^\\S\\n]+(?:(\\S+))?", "beginCaptures": { "1": { "name": "punctuation.definition.comment.scala" }, "2": { "name": "keyword.other.import.scala" }, "3": { "patterns": [{ "match": "[A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)", "name": "entity.name.import.scala" }, { "match": "\\.", "name": "punctuation.definition.import" }] } }, "end": "\\n", "name": "comment.line.shebang.scala", "patterns": [{ "include": "#constants" }, { "include": "#strings" }, { "match": "[^\\s,]+", "name": "string.quoted.double.scala" }] }, "xml-doublequotedString": { "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.xml" } }, "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.xml" } }, "name": "string.quoted.double.xml", "patterns": [{ "include": "#xml-entity" }] }, "xml-embedded-content": { "patterns": [{ "begin": "{", "captures": { "0": { "name": "meta.bracket.scala" } }, "end": "}", "name": "meta.source.embedded.scala", "patterns": [{ "include": "#code" }] }, { "captures": { "1": { "name": "entity.other.attribute-name.namespace.xml" }, "2": { "name": "entity.other.attribute-name.xml" }, "3": { "name": "punctuation.separator.namespace.xml" }, "4": { "name": "entity.other.attribute-name.localname.xml" } }, "match": " (?:([-_a-zA-Z0-9]+)((:)))?([_a-zA-Z-]+)=" }, { "include": "#xml-doublequotedString" }, { "include": "#xml-singlequotedString" }] }, "xml-entity": { "captures": { "1": { "name": "punctuation.definition.constant.xml" }, "3": { "name": "punctuation.definition.constant.xml" } }, "match": "(&)([:a-zA-Z_][:a-zA-Z0-9_.-]*|#[0-9]+|#x[0-9a-fA-F]+)(;)", "name": "constant.character.entity.xml" }, "xml-literal": { "patterns": [{ "begin": "(<)((?:([_a-zA-Z0-9][_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*))(?=(\\s[^>]*)?></\\2>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.xml" }, "3": { "name": "entity.name.tag.namespace.xml" }, "4": { "name": "entity.name.tag.xml" }, "5": { "name": "punctuation.separator.namespace.xml" }, "6": { "name": "entity.name.tag.localname.xml" } }, "comment": "We do not allow a tag name to start with a - since this would likely conflict with the <- operator. This is not very common for tag names anyway. Also code such as -- if (val <val2 || val> val3) will falsly be recognized as an xml tag. The solution is to put a space on either side of the comparison operator", "end": "(>(<))/(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]*[_a-zA-Z0-9])(>)", "endCaptures": { "1": { "name": "punctuation.definition.tag.xml" }, "2": { "name": "meta.scope.between-tag-pair.xml" }, "3": { "name": "entity.name.tag.namespace.xml" }, "4": { "name": "entity.name.tag.xml" }, "5": { "name": "punctuation.separator.namespace.xml" }, "6": { "name": "entity.name.tag.localname.xml" }, "7": { "name": "punctuation.definition.tag.xml" } }, "name": "meta.tag.no-content.xml", "patterns": [{ "include": "#xml-embedded-content" }] }, { "begin": "(</?)(?:([_a-zA-Z0-9][-_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*)(?=[^>]*?>)", "captures": { "1": { "name": "punctuation.definition.tag.xml" }, "2": { "name": "entity.name.tag.namespace.xml" }, "3": { "name": "entity.name.tag.xml" }, "4": { "name": "punctuation.separator.namespace.xml" }, "5": { "name": "entity.name.tag.localname.xml" } }, "end": "(/?>)", "name": "meta.tag.xml", "patterns": [{ "include": "#xml-embedded-content" }] }, { "include": "#xml-entity" }] }, "xml-singlequotedString": { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.xml" } }, "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.xml" } }, "name": "string.quoted.single.xml", "patterns": [{ "include": "#xml-entity" }] } }, "scopeName": "source.scala" });
|
|
2
2
|
var scala = [
|
|
3
3
|
lang
|
|
4
4
|
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LanguageRegistration } from '@shikijs/core';declare const reg: LanguageRegistration[];export default reg
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const lang = Object.freeze({ "displayName": "Terraform", "fileTypes": ["tf", "tfvars"], "name": "terraform", "patterns": [{ "include": "#comments" }, { "include": "#attribute_definition" }, { "include": "#block" }, { "include": "#expressions" }], "repository": { "attribute_access": { "begin": "\\.(?!\\*)", "beginCaptures": { "0": { "name": "keyword.operator.accessor.hcl" } }, "comment": "Matches traversal attribute access such as .attr", "end": "[[:alpha:]][\\w-]*|\\d*", "endCaptures": { "0": { "patterns": [{ "comment": "Attribute name", "match": "(?!null|false|true)[[:alpha:]][\\w-]*", "name": "variable.other.member.hcl" }, { "comment": "Optional attribute index", "match": "\\d+", "name": "constant.numeric.integer.hcl" }] } } }, "attribute_definition": { "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" } }, "comment": 'Identifier "=" with optional parens', "match": "(\\()?(\\b(?!null\\b|false\\b|true\\b)[[:alpha:]][[:alnum:]_-]*)(\\))?\\s*(\\=(?!\\=|\\>))\\s*", "name": "variable.declaration.hcl" }, "attribute_splat": { "begin": "\\.", "beginCaptures": { "0": { "name": "keyword.operator.accessor.hcl" } }, "comment": "Legacy attribute-only splat", "end": "\\*", "endCaptures": { "0": { "name": "keyword.operator.splat.hcl" } } }, "block": { "begin": '([\\w][\\-\\w]*)([\\s\\"\\-\\w]*)(\\{)', "beginCaptures": { "1": { "patterns": [{ "comment": "Known block type", "match": "\\bdata|check|import|locals|module|output|provider|resource|terraform|variable\\b", "name": "entity.name.type.terraform" }, { "comment": "Unknown block type", "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b", "name": "entity.name.type.hcl" }] }, "2": { "patterns": [{ "comment": "Block label", "match": '[\\"\\-\\w]+', "name": "variable.other.enummember.hcl" }] }, "3": { "name": "punctuation.section.block.begin.hcl" } }, "comment": 'This will match Terraform blocks like `resource "aws_instance" "web" {` or `module {`', "end": "\\}", "endCaptures": { "0": { "name": "punctuation.section.block.end.hcl" } }, "name": "meta.block.hcl", "patterns": [{ "include": "#comments" }, { "include": "#attribute_definition" }, { "include": "#block" }, { "include": "#expressions" }] }, "block_inline_comments": { "begin": "/\\*", "captures": { "0": { "name": "punctuation.definition.comment.hcl" } }, "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", "end": "\\*/", "name": "comment.block.hcl" }, "brackets": { "begin": "\\[", "beginCaptures": { "0": { "name": "punctuation.section.brackets.begin.hcl" } }, "end": "\\]", "endCaptures": { "0": { "name": "punctuation.section.brackets.end.hcl" } }, "patterns": [{ "comment": "Splat operator", "match": "\\*", "name": "keyword.operator.splat.hcl" }, { "include": "#comma" }, { "include": "#comments" }, { "include": "#inline_for_expression" }, { "include": "#inline_if_expression" }, { "include": "#expressions" }, { "include": "#local_identifiers" }] }, "char_escapes": { "comment": "Character Escapes", "match": '\\\\[nrt"\\\\]|\\\\u(\\h{8}|\\h{4})', "name": "constant.character.escape.hcl" }, "comma": { "comment": "Commas - used in certain expressions", "match": "\\,", "name": "punctuation.separator.hcl" }, "comments": { "patterns": [{ "include": "#hash_line_comments" }, { "include": "#double_slash_line_comments" }, { "include": "#block_inline_comments" }] }, "double_slash_line_comments": { "begin": "//", "captures": { "0": { "name": "punctuation.definition.comment.hcl" } }, "comment": "Line comments start with // sequence and end with the next newline sequence. A line comment is considered equivalent to a newline sequence", "end": "$\\n?", "name": "comment.line.double-slash.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": [{ "comment": "in keyword", "match": "\\bin\\b", "name": "keyword.operator.word.hcl" }, { "comment": "if keyword", "match": "\\bif\\b", "name": "keyword.control.conditional.hcl" }, { "match": "\\:", "name": "keyword.operator.hcl" }, { "include": "#expressions" }, { "include": "#comments" }, { "include": "#comma" }, { "include": "#local_identifiers" }] }, "functions": { "begin": "(\\w+)(\\()", "beginCaptures": { "1": { "patterns": [{ "match": "\\b(abs|abspath|alltrue|anytrue|base64decode|base64encode|base64gzip|base64sha256|base64sha512|basename|bcrypt|can|ceil|chomp|chunklist|cidrhost|cidrnetmask|cidrsubnet|cidrsubnets|coalesce|coalescelist|compact|concat|contains|csvdecode|dirname|distinct|element|endswith|file|filebase64|filebase64sha256|filebase64sha512|fileexists|filemd5|fileset|filesha1|filesha256|filesha512|flatten|floor|format|formatdate|formatlist|indent|index|join|jsondecode|jsonencode|keys|length|log|lookup|lower|matchkeys|max|md5|merge|min|nonsensitive|one|parseint|pathexpand|plantimestamp|pow|range|regex|regexall|replace|reverse|rsadecrypt|sensitive|setintersection|setproduct|setsubtract|setunion|sha1|sha256|sha512|signum|slice|sort|split|startswith|strcontains|strrev|substr|sum|templatefile|textdecodebase64|textencodebase64|timeadd|timecmp|timestamp|title|tobool|tolist|tomap|tonumber|toset|tostring|transpose|trim|trimprefix|trimspace|trimsuffix|try|upper|urlencode|uuid|uuidv5|values|yamldecode|yamlencode|zipmap)\\b", "name": "support.function.builtin.terraform" }] }, "2": { "name": "punctuation.section.parens.begin.hcl" } }, "comment": "Built-in function calls", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.parens.end.hcl" } }, "name": "meta.function-call.hcl", "patterns": [{ "include": "#comments" }, { "include": "#expressions" }, { "include": "#comma" }] }, "hash_line_comments": { "begin": "#", "captures": { "0": { "name": "punctuation.definition.comment.hcl" } }, "comment": "Line comments start with # sequence and end with the next newline sequence. A line comment is considered equivalent to a newline sequence", "end": "$\\n?", "name": "comment.line.number-sign.hcl" }, "hcl_type_keywords": { "comment": "Type keywords known to HCL.", "match": "\\b(any|string|number|bool|list|set|map|tuple|object)\\b", "name": "storage.type.hcl" }, "heredoc": { "begin": "(\\<\\<\\-?)\\s*(\\w+)\\s*$", "beginCaptures": { "1": { "name": "keyword.operator.heredoc.hcl" }, "2": { "name": "keyword.control.heredoc.hcl" } }, "comment": "String Heredoc", "end": "^\\s*\\2\\s*$", "endCaptures": { "0": { "name": "keyword.control.heredoc.hcl" } }, "name": "string.unquoted.heredoc.hcl", "patterns": [{ "include": "#string_interpolation" }] }, "inline_for_expression": { "begin": "(for)\\b", "beginCaptures": { "1": { "name": "keyword.control.hcl" } }, "end": "\\n", "patterns": [{ "match": "\\=\\>", "name": "storage.type.function.hcl" }, { "include": "#for_expression_body" }] }, "inline_if_expression": { "begin": "(if)\\b", "beginCaptures": { "1": { "name": "keyword.control.conditional.hcl" } }, "end": "\\n", "patterns": [{ "include": "#expressions" }, { "include": "#comments" }, { "include": "#comma" }, { "include": "#local_identifiers" }] }, "language_constants": { "comment": "Language Constants", "match": "\\b(true|false|null)\\b", "name": "constant.language.hcl" }, "literal_values": { "patterns": [{ "include": "#numeric_literals" }, { "include": "#language_constants" }, { "include": "#string_literals" }, { "include": "#heredoc" }, { "include": "#hcl_type_keywords" }, { "include": "#named_value_references" }] }, "local_identifiers": { "comment": "Local Identifiers", "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b", "name": "variable.other.readwrite.hcl" }, "named_value_references": { "comment": "Constant values available only to Terraform.", "match": "\\b(var|local|module|data|path|terraform)\\b", "name": "variable.other.readwrite.terraform" }, "numeric_literals": { "patterns": [{ "captures": { "1": { "name": "punctuation.separator.exponent.hcl" } }, "comment": "Integer, no fraction, optional exponent", "match": "\\b\\d+([Ee][+-]?)\\d+\\b", "name": "constant.numeric.float.hcl" }, { "captures": { "1": { "name": "punctuation.separator.decimal.hcl" }, "2": { "name": "punctuation.separator.exponent.hcl" } }, "comment": "Integer, fraction, optional exponent", "match": "\\b\\d+(\\.)\\d+(?:([Ee][+-]?)\\d+)?\\b", "name": "constant.numeric.float.hcl" }, { "comment": "Integers", "match": "\\b\\d+\\b", "name": "constant.numeric.integer.hcl" }] }, "object_for_expression": { "begin": "(\\{)\\s?(for)\\b", "beginCaptures": { "1": { "name": "punctuation.section.braces.begin.hcl" }, "2": { "name": "keyword.control.hcl" } }, "end": "\\}", "endCaptures": { "0": { "name": "punctuation.section.braces.end.hcl" } }, "patterns": [{ "match": "\\=\\>", "name": "storage.type.function.hcl" }, { "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": { "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.section.braces.begin.hcl" } }, "end": "\\}", "endCaptures": { "0": { "name": "punctuation.section.braces.end.hcl" } }, "name": "meta.braces.hcl", "patterns": [{ "include": "#comments" }, { "include": "#objects" }, { "include": "#inline_for_expression" }, { "include": "#inline_if_expression" }, { "captures": { "1": { "name": "meta.mapping.key.hcl variable.other.readwrite.hcl" }, "2": { "name": "keyword.operator.assignment.hcl", "patterns": [{ "match": "\\=\\>", "name": "storage.type.function.hcl" }] } }, "comment": "Literal, named object key", "match": "\\b((?!null|false|true)[[:alpha:]][[:alnum:]_-]*)\\s*(\\=\\>?)\\s*" }, { "captures": { "0": { "patterns": [{ "include": "#named_value_references" }] }, "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" } }, "comment": "String object key", "match": '\\b((").*("))\\s*(\\=)\\s*' }, { "begin": "^\\s*\\(", "beginCaptures": { "0": { "name": "punctuation.section.parens.begin.hcl" } }, "comment": "Computed object key (any expression between parens)", "end": "(\\))\\s*(=|:)\\s*", "endCaptures": { "1": { "name": "punctuation.section.parens.end.hcl" }, "2": { "name": "keyword.operator.hcl" } }, "name": "meta.mapping.key.hcl", "patterns": [{ "include": "#named_value_references" }, { "include": "#attribute_access" }] }, { "include": "#object_key_values" }] }, "operators": { "patterns": [{ "match": "\\>\\=", "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": "\\:" }] }, "parens": { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.section.parens.begin.hcl" } }, "comment": "Parens - matched *after* function syntax", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.parens.end.hcl" } }, "patterns": [{ "include": "#comments" }, { "include": "#expressions" }] }, "string_interpolation": { "begin": "(?<![%$])([%$]{)", "beginCaptures": { "1": { "name": "keyword.other.interpolation.begin.hcl" } }, "comment": "String interpolation", "end": "\\}", "endCaptures": { "0": { "name": "keyword.other.interpolation.end.hcl" } }, "name": "meta.interpolation.hcl", "patterns": [{ "comment": "Trim left whitespace", "match": "\\~\\s", "name": "keyword.operator.template.left.trim.hcl" }, { "comment": "Trim right whitespace", "match": "\\s\\~", "name": "keyword.operator.template.right.trim.hcl" }, { "comment": "if/else/endif and for/in/endfor directives", "match": "\\b(if|else|endif|for|in|endfor)\\b", "name": "keyword.control.hcl" }, { "include": "#expressions" }, { "include": "#local_identifiers" }] }, "string_literals": { "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.hcl" } }, "comment": "Strings", "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.hcl" } }, "name": "string.quoted.double.hcl", "patterns": [{ "include": "#string_interpolation" }, { "include": "#char_escapes" }] }, "tuple_for_expression": { "begin": "(\\[)\\s?(for)\\b", "beginCaptures": { "1": { "name": "punctuation.section.brackets.begin.hcl" }, "2": { "name": "keyword.control.hcl" } }, "end": "\\]", "endCaptures": { "0": { "name": "punctuation.section.brackets.end.hcl" } }, "patterns": [{ "include": "#for_expression_body" }] } }, "scopeName": "source.hcl.terraform", "aliases": ["tf", "tfvars"] });
|
|
2
|
+
var terraform = [
|
|
3
|
+
lang
|
|
4
|
+
];
|
|
5
|
+
|
|
6
|
+
export { terraform as default };
|
package/dist/langs/zig.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lang = Object.freeze({ "displayName": "
|
|
1
|
+
const lang = Object.freeze({ "displayName": "Zig", "fileTypes": ["zig", "zon"], "name": "zig", "patterns": [{ "include": "#comments" }, { "include": "#strings" }, { "include": "#keywords" }, { "include": "#operators" }, { "include": "#numbers" }, { "include": "#support" }, { "include": "#variables" }], "repository": { "commentContents": { "patterns": [{ "match": "\\b(TODO|FIXME|XXX|NOTE)\\b:?", "name": "keyword.todo.zig" }] }, "comments": { "patterns": [{ "begin": "//[!/](?=[^/])", "end": "$", "name": "comment.line.documentation.zig", "patterns": [{ "include": "#commentContents" }] }, { "begin": "//", "end": "$", "name": "comment.line.double-slash.zig", "patterns": [{ "include": "#commentContents" }] }] }, "keywords": { "patterns": [{ "match": "\\binline\\b(?!\\s*\\bfn\\b)", "name": "keyword.control.repeat.zig" }, { "match": "\\b(while|for)\\b", "name": "keyword.control.repeat.zig" }, { "match": "\\b(extern|packed|export|pub|noalias|inline|comptime|volatile|align|linksection|threadlocal|allowzero|noinline|callconv)\\b", "name": "keyword.storage.zig" }, { "match": "\\b(struct|enum|union|opaque)\\b", "name": "keyword.structure.zig" }, { "match": "\\b(asm|unreachable)\\b", "name": "keyword.statement.zig" }, { "match": "\\b(break|return|continue|defer|errdefer)\\b", "name": "keyword.control.flow.zig" }, { "match": "\\b(await|resume|suspend|async|nosuspend)\\b", "name": "keyword.control.async.zig" }, { "match": "\\b(try|catch)\\b", "name": "keyword.control.trycatch.zig" }, { "match": "\\b(if|else|switch|orelse)\\b", "name": "keyword.control.conditional.zig" }, { "match": "\\b(null|undefined)\\b", "name": "keyword.constant.default.zig" }, { "match": "\\b(true|false)\\b", "name": "keyword.constant.bool.zig" }, { "match": "\\b(usingnamespace|test|and|or)\\b", "name": "keyword.default.zig" }, { "match": "\\b(bool|void|noreturn|type|error|anyerror|anyframe|anytype|anyopaque)\\b", "name": "keyword.type.zig" }, { "match": "\\b(f16|f32|f64|f80|f128|u\\d+|i\\d+|isize|usize|comptime_int|comptime_float)\\b", "name": "keyword.type.integer.zig" }, { "match": "\\b(c_char|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|c_longlong|c_ulonglong|c_longdouble)\\b", "name": "keyword.type.c.zig" }] }, "numbers": { "patterns": [{ "match": "\\b0x[0-9a-fA-F][0-9a-fA-F_]*(\\.[0-9a-fA-F][0-9a-fA-F_]*)?([pP][+-]?[0-9a-fA-F_]+)?\\b", "name": "constant.numeric.hexfloat.zig" }, { "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?([eE][+-]?[0-9_]+)?\\b", "name": "constant.numeric.float.zig" }, { "match": "\\b[0-9][0-9_]*\\b", "name": "constant.numeric.decimal.zig" }, { "match": "\\b0x[a-fA-F0-9_]+\\b", "name": "constant.numeric.hexadecimal.zig" }, { "match": "\\b0o[0-7_]+\\b", "name": "constant.numeric.octal.zig" }, { "match": "\\b0b[01_]+\\b", "name": "constant.numeric.binary.zig" }, { "match": "\\b[0-9](([eEpP][+-])|[0-9a-zA-Z_])*(\\.(([eEpP][+-])|[0-9a-zA-Z_])*)?([eEpP][+-])?[0-9a-zA-Z_]*\\b", "name": "constant.numeric.invalid.zig" }] }, "operators": { "patterns": [{ "match": "(?<=\\[)\\*c(?=\\])", "name": "keyword.operator.c-pointer.zig" }, { "match": "(\\b(and|or)\\b)|(==|!=)", "name": "keyword.operator.comparison.zig" }, { "match": "(-%?|\\+%?|\\*%?|/|%)=?", "name": "keyword.operator.arithmetic.zig" }, { "match": "(<<%?|>>|!|&|\\^|\\|)=?", "name": "keyword.operator.bitwise.zig" }, { "match": "(==|\\+\\+|\\*\\*|->)", "name": "keyword.operator.special.zig" }] }, "stringcontent": { "patterns": [{ "match": `\\\\([nrt'"\\\\]|(x[0-9a-fA-F]{2})|(u\\{[0-9a-fA-F]+\\}))`, "name": "constant.character.escape.zig" }, { "match": "\\\\.", "name": "invalid.illegal.unrecognized-string-escape.zig" }] }, "strings": { "patterns": [{ "begin": '"', "end": '"', "name": "string.quoted.double.zig", "patterns": [{ "include": "#stringcontent" }] }, { "begin": "\\\\\\\\", "end": "$", "name": "string.multiline.zig" }, { "match": "'([^'\\\\]|\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.))'", "name": "string.quoted.single.zig" }] }, "support": { "patterns": [{ "comment": "Built-in functions", "match": "@[_a-zA-Z][_a-zA-Z0-9]*", "name": "support.function.builtin.zig" }] }, "variables": { "patterns": [{ "name": "meta.function.declaration.zig", "patterns": [{ "captures": { "1": { "name": "storage.type.function.zig" }, "2": { "name": "entity.name.type.zig" } }, "match": "\\b(fn)\\s+([A-Z][a-zA-Z0-9]*)\\b" }, { "captures": { "1": { "name": "storage.type.function.zig" }, "2": { "name": "entity.name.function.zig" } }, "match": "\\b(fn)\\s+([_a-zA-Z][_a-zA-Z0-9]*)\\b" }, { "begin": '\\b(fn)\\s+@"', "beginCaptures": { "1": { "name": "storage.type.function.zig" } }, "end": '"', "name": "entity.name.function.string.zig", "patterns": [{ "include": "#stringcontent" }] }, { "match": "\\b(const|var|fn)\\b", "name": "keyword.default.zig" }] }, { "name": "meta.function.call.zig", "patterns": [{ "match": "([A-Z][a-zA-Z0-9]*)(?=\\s*\\()", "name": "entity.name.type.zig" }, { "match": "([_a-zA-Z][_a-zA-Z0-9]*)(?=\\s*\\()", "name": "entity.name.function.zig" }] }, { "name": "meta.variable.zig", "patterns": [{ "match": "\\b[_a-zA-Z][_a-zA-Z0-9]*\\b", "name": "variable.zig" }, { "begin": '@"', "end": '"', "name": "variable.string.zig", "patterns": [{ "include": "#stringcontent" }] }] }] } }, "scopeName": "source.zig" });
|
|
2
2
|
var zig = [
|
|
3
3
|
lang
|
|
4
4
|
];
|