shiki 1.18.0 → 1.20.0
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/bundle-full.d.mts +0 -1
- package/dist/bundle-full.mjs +4 -3
- package/dist/bundle-web.d.mts +0 -1
- package/dist/bundle-web.mjs +4 -3
- package/dist/chunks/wasm-dynamic.mjs +3 -0
- package/dist/core-unwasm.d.mts +0 -4
- package/dist/core-unwasm.mjs +1 -1
- package/dist/core.d.mts +3 -2
- package/dist/core.mjs +0 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/langs/hcl.mjs +1 -1
- package/dist/langs/nushell.mjs +1 -1
- package/dist/langs/terraform.mjs +1 -1
- package/dist/theme-css-variables.d.mts +1 -37
- package/dist/theme-css-variables.mjs +3 -235
- package/dist/themes/one-dark-pro.mjs +1 -1
- package/dist/types/wasm-dynamic.d.mts +3 -0
- package/dist/wasm.d.mts +9 -2
- package/dist/wasm.mjs +9 -2
- package/package.json +7 -7
package/dist/bundle-full.d.mts
CHANGED
|
@@ -6,7 +6,6 @@ import { BundledLanguage } from './langs.mjs';
|
|
|
6
6
|
export { bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo } from './langs.mjs';
|
|
7
7
|
import { BundledTheme } from './themes.mjs';
|
|
8
8
|
export { bundledThemes, bundledThemesInfo } from './themes.mjs';
|
|
9
|
-
export { CssVariablesThemeOptions, createCssVariablesTheme } from './theme-css-variables.mjs';
|
|
10
9
|
export * from '@shikijs/core';
|
|
11
10
|
import '@shikijs/core/types';
|
|
12
11
|
|
package/dist/bundle-full.mjs
CHANGED
|
@@ -3,14 +3,14 @@ export { bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo } fro
|
|
|
3
3
|
import { g as getWasmInlined } from './chunks/wasm-dynamic.mjs';
|
|
4
4
|
import { bundledThemes } from './themes.mjs';
|
|
5
5
|
export { bundledThemesInfo } from './themes.mjs';
|
|
6
|
-
import { createdBundledHighlighter,
|
|
6
|
+
import { createdBundledHighlighter, createSingletonShorthands, warnDeprecated } from '@shikijs/core';
|
|
7
7
|
export * from '@shikijs/core';
|
|
8
|
-
|
|
8
|
+
import { createOnigurumaEngine } from '@shikijs/engine-oniguruma';
|
|
9
9
|
|
|
10
10
|
const createHighlighter = /* @__PURE__ */ createdBundledHighlighter({
|
|
11
11
|
langs: bundledLanguages,
|
|
12
12
|
themes: bundledThemes,
|
|
13
|
-
engine: () =>
|
|
13
|
+
engine: () => createOnigurumaEngine(getWasmInlined)
|
|
14
14
|
});
|
|
15
15
|
const {
|
|
16
16
|
codeToHtml,
|
|
@@ -24,6 +24,7 @@ const {
|
|
|
24
24
|
createHighlighter
|
|
25
25
|
);
|
|
26
26
|
const getHighlighter = (options) => {
|
|
27
|
+
warnDeprecated("`getHighlighter` is deprecated. Use `createHighlighter` or `getSingletonHighlighter` instead.");
|
|
27
28
|
return createHighlighter(options);
|
|
28
29
|
};
|
|
29
30
|
|
package/dist/bundle-web.d.mts
CHANGED
|
@@ -6,7 +6,6 @@ import { BundledLanguageInfo, DynamicImportLanguageRegistration } from '@shikijs
|
|
|
6
6
|
export * from '@shikijs/core';
|
|
7
7
|
import { BundledTheme } from './themes.mjs';
|
|
8
8
|
export { bundledThemes, bundledThemesInfo } from './themes.mjs';
|
|
9
|
-
export { CssVariablesThemeOptions, createCssVariablesTheme } from './theme-css-variables.mjs';
|
|
10
9
|
import '@shikijs/core/types';
|
|
11
10
|
|
|
12
11
|
declare const bundledLanguagesInfo: BundledLanguageInfo[];
|
package/dist/bundle-web.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { g as getWasmInlined } from './chunks/wasm-dynamic.mjs';
|
|
2
|
-
import { createdBundledHighlighter,
|
|
2
|
+
import { createdBundledHighlighter, createSingletonShorthands, warnDeprecated } from '@shikijs/core';
|
|
3
3
|
export * from '@shikijs/core';
|
|
4
4
|
import { bundledThemes } from './themes.mjs';
|
|
5
5
|
export { bundledThemesInfo } from './themes.mjs';
|
|
6
|
-
|
|
6
|
+
import { createOnigurumaEngine } from '@shikijs/engine-oniguruma';
|
|
7
7
|
|
|
8
8
|
const bundledLanguagesInfo = [
|
|
9
9
|
{
|
|
@@ -343,7 +343,7 @@ const bundledLanguages = {
|
|
|
343
343
|
const createHighlighter = /* @__PURE__ */ createdBundledHighlighter({
|
|
344
344
|
langs: bundledLanguages,
|
|
345
345
|
themes: bundledThemes,
|
|
346
|
-
engine: () =>
|
|
346
|
+
engine: () => createOnigurumaEngine(getWasmInlined)
|
|
347
347
|
});
|
|
348
348
|
const {
|
|
349
349
|
codeToHtml,
|
|
@@ -357,6 +357,7 @@ const {
|
|
|
357
357
|
createHighlighter
|
|
358
358
|
);
|
|
359
359
|
const getHighlighter = (options) => {
|
|
360
|
+
warnDeprecated("`getHighlighter` is deprecated. Use `createHighlighter` or `getSingletonHighlighter` instead.");
|
|
360
361
|
return createHighlighter(options);
|
|
361
362
|
};
|
|
362
363
|
|
package/dist/core-unwasm.d.mts
CHANGED
package/dist/core-unwasm.mjs
CHANGED
package/dist/core.d.mts
CHANGED
package/dist/core.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { Highlighter, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, createHighlighter, getHighlighter, getLastGrammarState, getSingletonHighlighter } from './bundle-full.mjs';
|
|
2
2
|
export { BuiltinLanguage, BuiltinTheme } from './types.mjs';
|
|
3
|
+
export { createJavaScriptRegexEngine, defaultJavaScriptRegexConstructor } from '@shikijs/engine-javascript';
|
|
4
|
+
export { createOnigurumaEngine, loadWasm } from '@shikijs/engine-oniguruma';
|
|
3
5
|
export { BundledLanguage, bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo } from './langs.mjs';
|
|
4
|
-
export { CssVariablesThemeOptions, createCssVariablesTheme } from './theme-css-variables.mjs';
|
|
5
6
|
export * from '@shikijs/core';
|
|
6
7
|
export { BundledTheme, bundledThemes, bundledThemesInfo } from './themes.mjs';
|
|
7
8
|
export { g as getWasmInlined } from './types/wasm-dynamic.mjs';
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, createHighlighter, getHighlighter, getLastGrammarState, getSingletonHighlighter } from './bundle-full.mjs';
|
|
2
|
+
export { createJavaScriptRegexEngine, defaultJavaScriptRegexConstructor } from '@shikijs/engine-javascript';
|
|
3
|
+
export { createOnigurumaEngine, loadWasm } from '@shikijs/engine-oniguruma';
|
|
2
4
|
export { bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo } from './langs.mjs';
|
|
3
|
-
export { createCssVariablesTheme } from './theme-css-variables.mjs';
|
|
4
5
|
export * from '@shikijs/core';
|
|
5
6
|
export { bundledThemes, bundledThemesInfo } from './themes.mjs';
|
|
6
7
|
export { g as getWasmInlined } from './chunks/wasm-dynamic.mjs';
|
package/dist/langs/hcl.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lang = Object.freeze(JSON.parse('{"displayName":"HashiCorp HCL","fileTypes":["hcl"],"name":"hcl","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":"[A-Za-z][\\\\w-]*|\\\\d*","endCaptures":{"0":{"patterns":[{"comment":"Attribute name","match":"(?!null|false|true)[A-Za-z][\\\\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)[A-Za-z][0-9A-Za-z_-]*)(\\\\))?\\\\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]*)([^?\\\\r\\\\n]*)(\\\\{)","beginCaptures":{"1":{"patterns":[{"comment":"Block type","match":"\\\\b(?!null|false|true)[A-Za-z][0-9A-Za-z_-]*\\\\b","name":"entity.name.type.hcl"}]},"2":{"patterns":[{"comment":"Block label (String Literal)","match":"\\\\\\"[^\\\\\\"\\\\r\\\\n]*\\\\\\"","name":"variable.other.enummember.hcl"},{"comment":"Block label (Indentifier)","match":"[A-Za-z][0-9A-Za-z_-]*","name":"variable.other.enummember.hcl"}]},"3":{"name":"punctuation.section.block.begin.hcl"}},"comment":"This will match HCL blocks like `thing1 \\"one\\" \\"two\\" {` or `thing2 {`","end":"\\\\}","endCaptures":{"0":{"name":"punctuation.section.block.end.hcl"}},"name":"meta.block.hcl","patterns":[{"include":"#comments"},{"include":"#attribute_definition"},{"include":"#expressions"},{"include":"#block"}]},"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[A-Za-z][\\\\w_-]*::([A-Za-z][\\\\w_-]*::)?[A-Za-z][\\\\w_-]*\\\\b","name":"support.function.namespaced.hcl"},{"match":"\\\\b[A-Za-z][\\\\w_-]*\\\\b","name":"support.function.builtin.hcl"}]},"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":{"captures":{"1":{"name":"keyword.control.hcl"},"2":{"patterns":[{"match":"=>","name":"storage.type.function.hcl"},{"include":"#for_expression_body"}]}},"match":"(for)\\\\b(.*)\\\\n"},"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"}]},"local_identifiers":{"comment":"Local Identifiers","match":"\\\\b(?!null|false|true)[A-Za-z][0-9A-Za-z_-]*\\\\b","name":"variable.other.readwrite.hcl"},"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"}},"comment":"Literal, named object key","match":"\\\\b((?!null|false|true)[A-Za-z][0-9A-Za-z_-]*)\\\\s*(=(?!=))\\\\s*"},{"captures":{"1":{"name":"meta.mapping.key.hcl string.quoted.double.hcl"},"2":{"name":"punctuation.definition.string.begin.hcl"},"3":{"name":"punctuation.definition.string.end.hcl"},"4":{"name":"keyword.operator.hcl"}},"comment":"String object key","match":"^\\\\s*((\\").*(\\"))\\\\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":"#attribute_access"},{"include":"#attribute_splat"}]},{"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":":","name":"keyword.operator.hcl"},{"match":"=>","name":"keyword.operator.hcl"}]},"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"}'));
|
|
1
|
+
const lang = Object.freeze(JSON.parse('{"displayName":"HashiCorp HCL","fileTypes":["hcl"],"name":"hcl","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":"[A-Za-z][\\\\w-]*|\\\\d*","endCaptures":{"0":{"patterns":[{"comment":"Attribute name","match":"(?!null|false|true)[A-Za-z][\\\\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)[A-Za-z][0-9A-Za-z_-]*)(\\\\))?\\\\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\\\\r\\\\n]*([\\\\w][\\\\-_\\\\w]*|\\\\\\"[^\\\\\\"\\\\r\\\\n]*\\\\\\"))*)[^\\\\S\\\\r\\\\n]*(\\\\{)","beginCaptures":{"1":{"patterns":[{"comment":"Block type","match":"\\\\b(?!null|false|true)[A-Za-z][0-9A-Za-z_-]*\\\\b","name":"entity.name.type.hcl"}]},"2":{"patterns":[{"comment":"Block label (String Literal)","match":"\\\\\\"[^\\\\\\"\\\\r\\\\n]*\\\\\\"","name":"variable.other.enummember.hcl"},{"comment":"Block label (Identifier)","match":"[A-Za-z][0-9A-Za-z_-]*","name":"variable.other.enummember.hcl"}]},"5":{"name":"punctuation.section.block.begin.hcl"}},"comment":"This will match HCL blocks like `thing1 \\"one\\" \\"two\\" {` or `thing2 {`","end":"\\\\}","endCaptures":{"0":{"name":"punctuation.section.block.end.hcl"}},"name":"meta.block.hcl","patterns":[{"include":"#comments"},{"include":"#attribute_definition"},{"include":"#expressions"},{"include":"#block"}]},"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[A-Za-z][\\\\w_-]*::([A-Za-z][\\\\w_-]*::)?[A-Za-z][\\\\w_-]*\\\\b","name":"support.function.namespaced.hcl"},{"match":"\\\\b[A-Za-z][\\\\w_-]*\\\\b","name":"support.function.builtin.hcl"}]},"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":{"captures":{"1":{"name":"keyword.control.hcl"},"2":{"patterns":[{"match":"=>","name":"storage.type.function.hcl"},{"include":"#for_expression_body"}]}},"match":"(for)\\\\b(.*)\\\\n"},"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"}]},"local_identifiers":{"comment":"Local Identifiers","match":"\\\\b(?!null|false|true)[A-Za-z][0-9A-Za-z_-]*\\\\b","name":"variable.other.readwrite.hcl"},"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"}},"comment":"Literal, named object key","match":"\\\\b((?!null|false|true)[A-Za-z][0-9A-Za-z_-]*)\\\\s*(=(?!=))\\\\s*"},{"captures":{"1":{"name":"meta.mapping.key.hcl string.quoted.double.hcl"},"2":{"name":"punctuation.definition.string.begin.hcl"},"3":{"name":"punctuation.definition.string.end.hcl"},"4":{"name":"keyword.operator.hcl"}},"comment":"String object key","match":"^\\\\s*((\\").*(\\"))\\\\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":"#attribute_access"},{"include":"#attribute_splat"}]},{"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":":","name":"keyword.operator.hcl"},{"match":"=>","name":"keyword.operator.hcl"}]},"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"}'));
|
|
2
2
|
var hcl = [
|
|
3
3
|
lang
|
|
4
4
|
];
|
package/dist/langs/nushell.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lang = Object.freeze(JSON.parse(`{"displayName":"nushell","name":"nushell","patterns":[{"include":"#define-variable"},{"include":"#define-alias"},{"include":"#function"},{"include":"#extern"},{"include":"#module"},{"include":"#use-module"},{"include":"#expression"},{"include":"#comment"}],"repository":{"binary":{"begin":"\\\\b(0x)(\\\\[)","beginCaptures":{"1":{"name":"constant.numeric.nushell"},"2":{"name":"meta.brace.square.begin.nushell"}},"end":"\\\\]","endCaptures":{"0":{"name":"meta.brace.square.begin.nushell"}},"name":"constant.binary.nushell","patterns":[{"match":"[0-9a-fA-F]{2}","name":"constant.numeric.nushell"}]},"braced-expression":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.block.begin.bracket.curly.nushell"}},"end":"\\\\}","endCaptures":{"0":{"name":"punctuation.section.block.end.bracket.curly.nushell"}},"name":"meta.expression.braced.nushell","patterns":[{"begin":"(?<=\\\\{)\\\\s*\\\\|","end":"\\\\|","name":"meta.closure.parameters.nushell","patterns":[{"include":"#function-parameter"}]},{"captures":{"1":{"name":"variable.other.nushell"},"2":{"name":"keyword.control.nushell"}},"match":"(\\\\w+)\\\\s*(:)\\\\s*"},{"captures":{"1":{"name":"variable.other.nushell"},"2":{"name":"variable.other.nushell","patterns":[{"include":"#paren-expression"}]},"3":{"name":"keyword.control.nushell"}},"match":"(\\\\$\\"((?:[^\\"\\\\\\\\]|\\\\\\\\.)*)\\")\\\\s*(:)\\\\s*","name":"meta.record-entry.nushell"},{"captures":{"1":{"name":"variable.other.nushell"},"2":{"name":"keyword.control.nushell"}},"match":"(\\"(?:[^\\"\\\\\\\\]|\\\\\\\\.)*\\")\\\\s*(:)\\\\s*","name":"meta.record-entry.nushell"},{"captures":{"1":{"name":"variable.other.nushell"},"2":{"name":"variable.other.nushell","patterns":[{"include":"#paren-expression"}]},"3":{"name":"keyword.control.nushell"}},"match":"(\\\\$'([^']*)')\\\\s*(:)\\\\s*","name":"meta.record-entry.nushell"},{"captures":{"1":{"name":"variable.other.nushell"},"2":{"name":"keyword.control.nushell"}},"match":"('[^']*')\\\\s*(:)\\\\s*","name":"meta.record-entry.nushell"},{"include":"#spread"},{"include":"source.nushell"}]},"command":{"begin":"(?<!\\\\w)(?:(\\\\^)|(?!\\\\d|\\\\$))([\\\\w.!]+(?:(?: (?!-)[\\\\w\\\\-.!]+(?:(?= |\\\\))|$)|[\\\\w\\\\-.!]+))*|(?<=\\\\^)\\\\$?(?:\\"[^\\"]+\\"|'[^']+'))","beginCaptures":{"1":{"name":"keyword.operator.nushell"},"2":{"patterns":[{"include":"#control-keywords"},{"captures":{"0":{"name":"keyword.other.builtin.nushell"}},"match":"(?:ansi|char) \\\\w+"},{"captures":{"1":{"name":"keyword.other.builtin.nushell"},"2":{"patterns":[{"include":"#value"}]}},"comment":"Regex generated with list-to-tree (https://github.com/glcraft/list-to-tree)","match":"(a(?:l(?:ias|l)|n(?:si(?: (?:gradient|link|strip))?|y)|ppend|st)|b(?:g|its(?: (?:and|not|or|ro(?:l|r)|sh(?:l|r)|xor))?|reak|ytes(?: (?:a(?:dd|t)|build|collect|ends-with|index-of|length|re(?:move|place|verse)|starts-with))?)|c(?:al|d|har|l(?:ear|ipboard (?:copy|paste))|o(?:l(?:lect|umns)|m(?:mandline(?: (?:edit|get-cursor|set-cursor))?|p(?:act|lete))|n(?:fig(?: (?:env|nu|reset))?|st|tinue))|p|ustom-value (?:generate(?:2)?|update(?:-arg)?))|d(?:ate(?: (?:format|humanize|list-timezone|now|to-(?:record|t(?:able|imezone))))?|e(?:bug(?: info)?|code(?: (?:base64|hex))?|f(?:ault)?|scribe|tect columns)|fr(?: (?:a(?:gg(?:-groups)?|ll-(?:false|true)|ppend|rg-(?:m(?:ax|in)|sort|true|unique|where)|s(?:-date(?:time)?)?)|c(?:a(?:che|st)|o(?:l(?:lect|umns)?|n(?:cat(?:-str|enate)|tains)|unt(?:-null)?)|umulative)|d(?:atepart|rop(?:-(?:duplicates|nulls))?|types|ummies)|exp(?:lode|r-not)|f(?:etch|i(?:l(?:l-n(?:an|ull)|ter(?:-with)?)|rst)|latten)|g(?:et(?:-(?:day|hour|m(?:inute|onth)|nanosecond|ordinal|second|week(?:day)?|year))?|roup-by)|i(?:mplode|nto-(?:df|lazy|nu)|s-(?:duplicated|in|n(?:ot-null|ull)|unique))|join|l(?:ast|it|owercase|s)|m(?:ax|e(?:an|dian|lt)|in)|n(?:-unique|ot)|o(?:pen|therwise)|qu(?:antile|ery)|r(?:e(?:name|place(?:-all)?|verse)|olling)|s(?:ample|chema|e(?:lect|t(?:-with-idx)?)|h(?:ape|ift)|lice|ort-by|t(?:d|r(?:-(?:lengths|slice)|ftime))|um(?:mary)?)|t(?:ake|o-(?:a(?:rrow|vro)|csv|jsonl|parquet))|u(?:nique|ppercase)|va(?:lue-counts|r)|w(?:hen|ith-column)))?|o|rop(?: (?:column|nth))?|u)|e(?:ach(?: while)?|cho|moji|n(?:code(?: (?:base64|hex))?|umerate)|rror make|very|x(?:ec|it|p(?:l(?:ain|ore)|ort(?: (?:alias|const|def|extern|module|use)|-env)?)|tern))|f(?:i(?:l(?:e|l|ter)|nd|rst)|latten|mt|or(?:mat(?: (?:d(?:ate|uration)|filesize|pattern))?)?|rom(?: (?:csv|eml|i(?:cs|ni)|json|nuon|ods|p(?:arquet|ng)|ssv|t(?:oml|sv)|url|vcf|x(?:lsx|ml)|y(?:aml|ml)))?)|g(?:e(?:nerate|t)|lob|r(?:id|oup(?:-by)?)|stat)|h(?:ash(?: (?:md5|sha256))?|e(?:aders|lp(?: (?:aliases|commands|e(?:scapes|xterns)|modules|operators))?)|i(?:de(?:-env)?|ghlight|st(?:o(?:gram|ry(?: session)?))?)|ttp(?: (?:delete|get|head|options|p(?:atch|ost|ut)))?)|i(?:f|gnore|n(?:c|put(?: list(?:en)?)?|s(?:ert|pect)|t(?:erleave|o(?: (?:b(?:i(?:nary|ts)|ool)|cell-path|d(?:atetime|uration)|f(?:ilesize|loat)|glob|int|record|s(?:qlite|tring)|value))?))|s-(?:admin|empty|not-empty|terminal)|tems)|j(?:oin|son path|walk)|k(?:eybindings(?: (?:default|list(?:en)?))?|ill)|l(?:a(?:st|zy make)|e(?:ngth|t(?:-env)?)|ines|o(?:ad-env|op)|s)|m(?:at(?:ch|h(?: (?:a(?:bs|rc(?:cos(?:h)?|sin(?:h)?|tan(?:h)?)|vg)|c(?:eil|os(?:h)?)|exp|floor|l(?:n|og)|m(?:ax|edian|in|ode)|product|round|s(?:in(?:h)?|qrt|tddev|um)|tan(?:h)?|variance))?)|e(?:rge|tadata)|k(?:dir|temp)|o(?:dule|ve)|ut|v)|nu-(?:check|example-(?:1|2|3|config)|highlight)|o(?:pen|verlay(?: (?:hide|list|new|use))?)|p(?:a(?:nic|r(?:-each|se)|th(?: (?:basename|dirname|ex(?:ists|pand)|join|parse|relative-to|split|type))?)|eriodic-table|lot|net|ort(?: (?:list|scan))?|r(?:epend|int)|s)|query(?: (?:db|git|json|web|xml))?|r(?:an(?:dom(?: (?:bool|chars|dice|float|int|uuid))?|ge)|e(?:duce|g(?:ex|ist(?:er|ry query))|ject|name|turn|verse)|m|o(?:ll(?: (?:down|left|right|up))?|tate)|un-external)|s(?:ave|c(?:hema|ope(?: (?:aliases|commands|e(?:ngine-stats|xterns)|modules|variables))?)|e(?:lect|q(?: (?:char|date))?)|huffle|kip(?: (?:until|while))?|leep|o(?:rt(?:-by)?|urce(?:-env)?)|plit(?: (?:c(?:hars|olumn)|list|row|words)|-by)?|t(?:art|or(?: (?:create|delete|export|i(?:mport|nsert)|open|reset|update))?|r(?: (?:c(?:a(?:mel-case|pitalize)|ontains)|d(?:istance|owncase)|e(?:nds-with|scape-glob|xpand)|index-of|join|kebab-case|length|pascal-case|re(?:place|verse)|s(?:creaming-snake-case|imilarity|nake-case|ta(?:rts-with|ts)|ubstring)|t(?:itle-case|rim)|upcase)|eam_example(?: (?:collect-external|s(?:eq|um)))?)?)|ys)|t(?:a(?:ble|ke(?: (?:until|while))?)|e(?:e|rm size)|imeit|o(?: (?:csv|html|json|md|nuon|png|qr|t(?:ext|oml|sv)|xml|yaml)|uch)?|r(?:anspose|y)|utor)|u(?:limit|ni(?:q(?:-by)?|ts)|p(?:date(?: cells)?|sert)|rl(?: (?:build-query|decode|encode|join|parse))?|se)|v(?:alues|ersion|iew(?: (?:files|s(?:ource|pan)))?)|w(?:atch|h(?:ere|i(?:ch|le)|oami)|i(?:ndow|th-env)|rap)|xyplot|zip)(?![\\\\w-])( (.*))?"},{"captures":{"1":{"patterns":[{"include":"#paren-expression"}]}},"match":"(?<=\\\\^)(?:\\\\$(\\"[^\\"]+\\"|'[^']+')|\\"[^\\"]+\\"|'[^']+')","name":"entity.name.type.external.nushell"},{"captures":{"1":{"name":"entity.name.type.external.nushell"},"2":{"patterns":[{"include":"#value"}]}},"match":"([\\\\w.]+(?:-[\\\\w.!]+)*)(?: (.*))?"},{"include":"#value"}]}},"end":"(?=\\\\||\\\\)|\\\\}|;)|$","name":"meta.command.nushell","patterns":[{"include":"#parameters"},{"include":"#spread"},{"include":"#value"}]},"comment":{"match":"(#.*)$","name":"comment.nushell"},"constant-keywords":{"match":"\\\\b(?:true|false|null)\\\\b","name":"constant.language.nushell"},"constant-value":{"patterns":[{"include":"#constant-keywords"},{"include":"#datetime"},{"include":"#numbers"},{"include":"#numbers-hexa"},{"include":"#binary"}]},"control-keywords":{"comment":"Regex generated with list-to-tree (https://github.com/glcraft/list-to-tree)","match":"(?<![0-9a-zA-Z_\\\\-.\\\\/:\\\\\\\\])(?:break|continue|else(?: if)?|for|if|loop|mut|return|try|while)(?![0-9a-zA-Z_\\\\-.\\\\/:\\\\\\\\])","name":"keyword.control.nushell"},"datetime":{"match":"\\\\b\\\\d{4}-\\\\d{2}-\\\\d{2}(?:T\\\\d{2}:\\\\d{2}:\\\\d{2}(?:\\\\.\\\\d+)?(?:\\\\+\\\\d{2}:?\\\\d{2}|Z)?)?\\\\b","name":"constant.numeric.nushell"},"define-alias":{"captures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.type.nushell"},"3":{"patterns":[{"include":"#operators"}]}},"match":"((?:export )?alias)\\\\s+([\\\\w\\\\-!]+)\\\\s*(=)"},"define-variable":{"captures":{"1":{"name":"keyword.other.nushell"},"2":{"name":"variable.other.nushell"},"3":{"patterns":[{"include":"#operators"}]}},"match":"(let|mut|(?:export\\\\s+)?const)\\\\s+(\\\\w+)\\\\s+(=)"},"expression":{"patterns":[{"include":"#pre-command"},{"include":"#for-loop"},{"include":"#operators"},{"match":"\\\\|","name":"keyword.control.nushell"},{"include":"#control-keywords"},{"include":"#constant-value"},{"include":"#command"},{"include":"#value"}]},"extern":{"begin":"((?:export\\\\s+)?extern)\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\")","beginCaptures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.type.nushell"}},"end":"(?<=\\\\])","endCaptures":{"0":{"name":"punctuation.definition.function.end.nushell"}},"patterns":[{"include":"#function-parameters"}]},"for-loop":{"begin":"(for)\\\\s+(\\\\$?\\\\w+)\\\\s+(in)\\\\s+(.+)\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"keyword.other.nushell"},"2":{"name":"variable.other.nushell"},"3":{"name":"keyword.other.nushell"},"4":{"patterns":[{"include":"#value"}]},"5":{"name":"punctuation.section.block.begin.bracket.curly.nushell"}},"end":"\\\\}","endCaptures":{"0":{"name":"punctuation.section.block.end.bracket.curly.nushell"}},"name":"meta.for-loop.nushell","patterns":[{"include":"source.nushell"}]},"function":{"begin":"((?:export\\\\s+)?def(?:\\\\s+--\\\\w+)*)\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+'|\`[\\\\w\\\\- ]+\`)(\\\\s+--\\\\w+)*","beginCaptures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.type.nushell"},"3":{"name":"entity.name.function.nushell"}},"end":"(?<=\\\\})","patterns":[{"include":"#function-parameters"},{"include":"#function-body"},{"include":"#function-inout"}]},"function-body":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.function.begin.nushell"}},"end":"\\\\}","endCaptures":{"0":{"name":"punctuation.definition.function.end.nushell"}},"name":"meta.function.body.nushell","patterns":[{"include":"source.nushell"}]},"function-inout":{"patterns":[{"include":"#types"},{"match":"->","name":"keyword.operator.nushell"},{"include":"#function-multiple-inout"}]},"function-multiple-inout":{"begin":"(?<=]\\\\s*)(:)\\\\s+(\\\\[)","beginCaptures":{"1":{"name":"punctuation.definition.in-out.nushell"},"2":{"name":"meta.brace.square.begin.nushell"}},"end":"\\\\]","endCaptures":{"0":{"name":"meta.brace.square.end.nushell"}},"patterns":[{"include":"#types"},{"captures":{"1":{"name":"punctuation.separator.nushell"}},"match":"\\\\s*(,)\\\\s*"},{"captures":{"1":{"name":"keyword.operator.nushell"}},"match":"\\\\s+(->)\\\\s+"}]},"function-parameter":{"patterns":[{"captures":{"1":{"name":"keyword.control.nushell"}},"match":"(-{0,2}|\\\\.{3})[\\\\w-]+(?:\\\\((-[\\\\w?])\\\\))?","name":"variable.parameter.nushell"},{"begin":"\\\\??:\\\\s*","end":"(?=(?:\\\\s+(?:-{0,2}|\\\\.{3})[\\\\w-]+)|(?:\\\\s*(?:,|\\\\]|\\\\||@|=|#|$)))","patterns":[{"include":"#types"}]},{"begin":"@(?=\\"|')","end":"(?<=\\"|')","patterns":[{"include":"#string"}]},{"begin":"=\\\\s*","end":"(?=(?:\\\\s+-{0,2}[\\\\w-]+)|(?:\\\\s*(?:,|\\\\]|\\\\||#|$)))","name":"default.value.nushell","patterns":[{"include":"#value"}]}]},"function-parameters":{"begin":"\\\\[","beginCaptures":{"0":{"name":"meta.brace.square.begin.nushell"}},"end":"\\\\]","endCaptures":{"0":{"name":"meta.brace.square.end.nushell"}},"name":"meta.function.parameters.nushell","patterns":[{"include":"#function-parameter"},{"include":"#comment"}]},"internal-variables":{"match":"\\\\$(?:nu|env)\\\\b","name":"variable.language.nushell"},"keyword":{"match":"(?:def(?:-env)?)","name":"keyword.other.nushell"},"module":{"begin":"((?:export\\\\s+)?module)\\\\s+([\\\\w\\\\-]+)\\\\s*\\\\{","beginCaptures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.namespace.nushell"}},"end":"\\\\}","endCaptures":{"0":{"name":"punctuation.definition.module.end.nushell"}},"name":"meta.module.nushell","patterns":[{"include":"source.nushell"}]},"numbers":{"match":"(?<![\\\\w-])[-+]?(?:\\\\d+|\\\\d{1,3}(?:_\\\\d{3})*)(?:\\\\.\\\\d*)?(?i:ns|us|ms|sec|min|hr|day|wk|b|kb|mb|gb|tb|pt|eb|zb|kib|mib|gib|tib|pit|eib|zib)?(?:(?![\\\\w.])|(?=\\\\.\\\\.))","name":"constant.numeric.nushell"},"numbers-hexa":{"match":"(?<![\\\\w-])0x[0-9a-fA-F]+(?![\\\\w.])","name":"constant.numeric.nushell"},"operators":{"patterns":[{"include":"#operators-word"},{"include":"#operators-symbols"},{"include":"#ranges"}]},"operators-symbols":{"match":"(?<= )(?:(?:\\\\+|-|\\\\*|\\\\/)=?|\\\\/\\\\/|\\\\*\\\\*|!=|[<>=]=?|[!=]~|\\\\+\\\\+=?)(?= |$)","name":"keyword.control.nushell"},"operators-word":{"match":"(?<= |\\\\()(?:mod|in|not-in|not|and|or|xor|bit-or|bit-and|bit-xor|bit-shl|bit-shr|starts-with|ends-with)(?= |\\\\)|$)","name":"keyword.control.nushell"},"parameters":{"captures":{"1":{"name":"keyword.control.nushell"}},"match":"(?<=\\\\s)(-{1,2})[\\\\w-]+","name":"variable.parameter.nushell"},"paren-expression":{"begin":"\\\\(","beginCaptures":{"0":{"name":"meta.brace.round.begin.nushell"}},"end":"\\\\)","endCaptures":{"0":{"name":"meta.brace.round.end.nushell"}},"name":"meta.expression.parenthesis.nushell","patterns":[{"include":"#expression"}]},"pre-command":{"begin":"(\\\\w+)(=)","beginCaptures":{"1":{"name":"variable.other.nushell"},"2":{"patterns":[{"include":"#operators"}]}},"end":"(?=\\\\s+)","patterns":[{"include":"#value"}]},"ranges":{"match":"\\\\.\\\\.<?","name":"keyword.control.nushell"},"spread":{"match":"\\\\.\\\\.\\\\.(?=[^\\\\s\\\\]}])","name":"keyword.control.nushell"},"string":{"patterns":[{"include":"#string-single-quote"},{"include":"#string-backtick"},{"include":"#string-double-quote"},{"include":"#string-interpolated-double"},{"include":"#string-interpolated-single"},{"include":"#string-bare"}]},"string-backtick":{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.nushell"}},"end":"\`","endCaptures":{"0":{"name":"punctuation.definition.string.end.nushell"}},"name":"string.quoted.single.nushell"},"string-bare":{"match":"[^$\\\\[{(\\"',|#\\\\s|][^\\\\[\\\\]{}()\\"'\\\\s#,|]*","name":"string.bare.nushell"},"string-double-quote":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.nushell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.nushell"}},"name":"string.quoted.double.nushell","patterns":[{"match":"\\\\w+"},{"include":"#string-escape"}]},"string-escape":{"match":"\\\\\\\\(?:[bfrnt\\\\\\\\'\\"/]|u[0-9a-fA-F]{4})","name":"constant.character.escape.nushell"},"string-interpolated-double":{"begin":"\\\\$\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.nushell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.nushell"}},"name":"string.interpolated.double.nushell","patterns":[{"match":"\\\\\\\\[()]","name":"constant.character.escape.nushell"},{"include":"#string-escape"},{"include":"#paren-expression"}]},"string-interpolated-single":{"begin":"\\\\$'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.nushell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.nushell"}},"name":"string.interpolated.single.nushell","patterns":[{"include":"#paren-expression"}]},"string-single-quote":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.nushell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.nushell"}},"name":"string.quoted.single.nushell"},"table":{"begin":"\\\\[","beginCaptures":{"0":{"name":"meta.brace.square.begin.nushell"}},"end":"\\\\]","endCaptures":{"0":{"name":"meta.brace.square.end.nushell"}},"name":"meta.table.nushell","patterns":[{"include":"#spread"},{"include":"#value"},{"match":",","name":"punctuation.separator.nushell"}]},"types":{"patterns":[{"begin":"\\\\b(list)\\\\s*<","beginCaptures":{"1":{"name":"entity.name.type.nushell"}},"end":">","name":"meta.list.nushell","patterns":[{"include":"#types"}]},{"begin":"\\\\b(record)\\\\s*<","beginCaptures":{"1":{"name":"entity.name.type.nushell"}},"end":">","name":"meta.record.nushell","patterns":[{"captures":{"1":{"name":"variable.parameter.nushell"}},"match":"([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[^']+')\\\\s*:\\\\s*"},{"include":"#types"}]},{"match":"\\\\b(\\\\w+)\\\\b","name":"entity.name.type.nushell"}]},"use-module":{"patterns":[{"captures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.namespace.nushell"},"3":{"name":"keyword.other.nushell"}},"match":"^\\\\s*((?:export )?use)\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+')(?:\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+'|\\\\*))?\\\\s*;?$"},{"begin":"^\\\\s*((?:export )?use)\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+')\\\\s*\\\\[","beginCaptures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.namespace.nushell"}},"end":"(\\\\])\\\\s*;?\\\\s*$","endCaptures":{"1":{"name":"meta.brace.square.end.nushell"}},"patterns":[{"captures":{"1":{"name":"keyword.other.nushell"}},"match":"([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+'|\\\\*),?"},{"include":"#comment"}]},{"captures":{"2":{"name":"entity.name.function.nushell"},"3":{"name":"string.bare.nushell","patterns":[{"captures":{"1":{"name":"entity.name.namespace.nushell"}},"match":"([\\\\w\\\\- ]+)(?:\\\\.nu)?(?=$|\\"|')"}]},"4":{"name":"keyword.other.nushell"}},"match":"(?<path>(?:/|\\\\\\\\|~[\\\\/\\\\\\\\]|\\\\.\\\\.?[\\\\/\\\\\\\\])?(?:[^\\\\/\\\\\\\\]+[\\\\/\\\\\\\\])*[\\\\w\\\\- ]+(?:\\\\.nu)?){0}^\\\\s*((?:export )?use)\\\\s+(\\"\\\\g<path>\\"|'\\\\g<path>\\\\'|(?![\\"'])\\\\g<path>)(?:\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[^']+'|\\\\*))?\\\\s*;?$"},{"begin":"(?<path>(?:/|\\\\\\\\|~[\\\\/\\\\\\\\]|\\\\.\\\\.?[\\\\/\\\\\\\\])?(?:[^\\\\/\\\\\\\\]+[\\\\/\\\\\\\\])*[\\\\w\\\\- ]+(?:\\\\.nu)?){0}^\\\\s*((?:export )?use)\\\\s+(\\"\\\\g<path>\\"|'\\\\g<path>\\\\'|(?![\\"'])\\\\g<path>)\\\\s+\\\\[","beginCaptures":{"2":{"name":"entity.name.function.nushell"},"3":{"name":"string.bare.nushell","patterns":[{"captures":{"1":{"name":"entity.name.namespace.nushell"}},"match":"([\\\\w\\\\- ]+)(?:\\\\.nu)?(?=$|\\"|')"}]}},"end":"(\\\\])\\\\s*;?\\\\s*$","endCaptures":{"1":{"name":"meta.brace.square.end.nushell"}},"patterns":[{"captures":{"0":{"name":"keyword.other.nushell"}},"match":"([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+'|\\\\*),?"},{"include":"#comment"}]},{"captures":{"0":{"name":"entity.name.function.nushell"}},"match":"^\\\\s*(?:export )?use\\\\b"}]},"value":{"patterns":[{"include":"#variables"},{"include":"#variable-fields"},{"include":"#control-keywords"},{"include":"#constant-value"},{"include":"#table"},{"include":"#operators"},{"include":"#paren-expression"},{"include":"#braced-expression"},{"include":"#string"},{"include":"#comment"}]},"variable-fields":{"match":"(?<=\\\\)|\\\\}|\\\\])(?:\\\\.(?:[\\\\w-]+|\\"[\\\\w\\\\- ]+\\"))+","name":"variable.other.nushell"},"variables":{"captures":{"1":{"patterns":[{"include":"#internal-variables"},{"match":"\\\\$.+","name":"variable.other.nushell"}]},"2":{"name":"variable.other.nushell"}},"match":"(\\\\$\\\\w+)((?:\\\\.(?:[\\\\w-]+|\\"[\\\\w\\\\- ]+\\"))*)"}},"scopeName":"source.nushell","aliases":["nu"]}`));
|
|
1
|
+
const lang = Object.freeze(JSON.parse(`{"displayName":"nushell","name":"nushell","patterns":[{"include":"#define-variable"},{"include":"#define-alias"},{"include":"#function"},{"include":"#extern"},{"include":"#module"},{"include":"#use-module"},{"include":"#expression"},{"include":"#comment"}],"repository":{"binary":{"begin":"\\\\b(0x)(\\\\[)","beginCaptures":{"1":{"name":"constant.numeric.nushell"},"2":{"name":"meta.brace.square.begin.nushell"}},"end":"\\\\]","endCaptures":{"0":{"name":"meta.brace.square.begin.nushell"}},"name":"constant.binary.nushell","patterns":[{"match":"[0-9a-fA-F]{2}","name":"constant.numeric.nushell"}]},"braced-expression":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.block.begin.bracket.curly.nushell"}},"end":"\\\\}","endCaptures":{"0":{"name":"punctuation.section.block.end.bracket.curly.nushell"}},"name":"meta.expression.braced.nushell","patterns":[{"begin":"(?<=\\\\{)\\\\s*\\\\|","end":"\\\\|","name":"meta.closure.parameters.nushell","patterns":[{"include":"#function-parameter"}]},{"captures":{"1":{"name":"variable.other.nushell"},"2":{"name":"keyword.control.nushell"}},"match":"(\\\\w+)\\\\s*(:)\\\\s*"},{"captures":{"1":{"name":"variable.other.nushell"},"2":{"name":"variable.other.nushell","patterns":[{"include":"#paren-expression"}]},"3":{"name":"keyword.control.nushell"}},"match":"(\\\\$\\"((?:[^\\"\\\\\\\\]|\\\\\\\\.)*)\\")\\\\s*(:)\\\\s*","name":"meta.record-entry.nushell"},{"captures":{"1":{"name":"variable.other.nushell"},"2":{"name":"keyword.control.nushell"}},"match":"(\\"(?:[^\\"\\\\\\\\]|\\\\\\\\.)*\\")\\\\s*(:)\\\\s*","name":"meta.record-entry.nushell"},{"captures":{"1":{"name":"variable.other.nushell"},"2":{"name":"variable.other.nushell","patterns":[{"include":"#paren-expression"}]},"3":{"name":"keyword.control.nushell"}},"match":"(\\\\$'([^']*)')\\\\s*(:)\\\\s*","name":"meta.record-entry.nushell"},{"captures":{"1":{"name":"variable.other.nushell"},"2":{"name":"keyword.control.nushell"}},"match":"('[^']*')\\\\s*(:)\\\\s*","name":"meta.record-entry.nushell"},{"include":"#spread"},{"include":"source.nushell"}]},"command":{"begin":"(?<!\\\\w)(?:(\\\\^)|(?!\\\\d|\\\\$))([\\\\w.!]+(?:(?: (?!-)[\\\\w\\\\-.!]+(?:(?= |\\\\))|$)|[\\\\w\\\\-.!]+))*|(?<=\\\\^)\\\\$?(?:\\"[^\\"]+\\"|'[^']+'))","beginCaptures":{"1":{"name":"keyword.operator.nushell"},"2":{"patterns":[{"include":"#control-keywords"},{"captures":{"0":{"name":"keyword.other.builtin.nushell"}},"match":"(?:ansi|char) \\\\w+"},{"captures":{"1":{"name":"keyword.other.builtin.nushell"},"2":{"patterns":[{"include":"#value"}]}},"comment":"Regex generated with list-to-tree (https://github.com/glcraft/list-to-tree)","match":"(a(?:l(?:ias|l)|n(?:si(?: (?:gradient|link|strip))?|y)|ppend|st)|b(?:g|its(?: (?:and|not|or|ro(?:l|r)|sh(?:l|r)|xor))?|reak|ytes(?: (?:a(?:dd|t)|build|collect|ends-with|index-of|length|re(?:move|place|verse)|starts-with))?)|c(?:al|d|h(?:ar|unks)|lear|o(?:l(?:lect|umns)|m(?:mandline(?: (?:edit|get-cursor|set-cursor))?|p(?:act|lete))|n(?:fig(?: (?:env|nu|reset))?|st|tinue))|p)|d(?:ate(?: (?:format|humanize|list-timezone|now|to-(?:record|t(?:able|imezone))))?|e(?:bug(?: (?:info|profile))?|code(?: (?:base(?:32(?:hex)?|64)|hex|new-base64))?|f(?:ault)?|scribe|tect columns)|o|rop(?: (?:column|nth))?|t(?: (?:add|diff|format|now|part|to|utcnow))?|u)|e(?:ach(?: while)?|cho|moji|n(?:code(?: (?:base(?:32(?:hex)?|64)|hex|new-base64))?|umerate)|rror make|very|x(?:ec|it|p(?:l(?:ain|ore)|ort(?: (?:alias|const|def|extern|module|use)|-env)?)|tern))|f(?:i(?:l(?:e|l|ter)|nd|rst)|latten|mt|or(?:mat(?: (?:d(?:ate|uration)|filesize|pattern))?)?|rom(?: (?:csv|eml|i(?:cs|ni)|json|msgpack(?:z)?|nuon|ods|p(?:arquet|list)|ssv|t(?:oml|sv)|url|vcf|x(?:lsx|ml)|y(?:aml|ml)))?)|g(?:e(?:nerate|t)|lob|r(?:id|oup(?:-by)?)|stat)|h(?:ash(?: (?:md5|sha256))?|e(?:aders|lp(?: (?:aliases|commands|e(?:scapes|xterns)|modules|operators))?)|i(?:de(?:-env)?|sto(?:gram|ry(?: session)?))|ttp(?: (?:delete|get|head|options|p(?:atch|ost|ut)))?)|i(?:f|gnore|n(?:c|put(?: list(?:en)?)?|s(?:ert|pect)|t(?:erleave|o(?: (?:b(?:i(?:nary|ts)|ool)|cell-path|d(?:atetime|uration)|f(?:ilesize|loat)|glob|int|record|s(?:qlite|tring)|value))?))|s-(?:admin|empty|not-empty|terminal)|tems)|j(?:oin|son path|walk)|k(?:eybindings(?: (?:default|list(?:en)?))?|ill)|l(?:ast|e(?:ngth|t(?:-env)?)|ines|o(?:ad-env|op)|s)|m(?:at(?:ch|h(?: (?:a(?:bs|rc(?:cos(?:h)?|sin(?:h)?|tan(?:h)?)|vg)|c(?:eil|os(?:h)?)|exp|floor|l(?:n|og)|m(?:ax|edian|in|ode)|product|round|s(?:in(?:h)?|qrt|tddev|um)|tan(?:h)?|variance))?)|d|e(?:rge|tadata(?: (?:access|set))?)|k(?:dir|temp)|o(?:dule|ve)|ut|v)|nu-(?:check|highlight)|o(?:pen|verlay(?: (?:hide|list|new|use))?)|p(?:a(?:nic|r(?:-each|se)|th(?: (?:basename|dirname|ex(?:ists|pand)|join|parse|relative-to|split|type))?)|lugin(?: (?:add|list|rm|stop|use))?|net|o(?:lars(?: (?:a(?:gg(?:-groups)?|ll-(?:false|true)|ppend|rg-(?:m(?:ax|in)|sort|true|unique|where)|s(?:-date(?:time)?)?)|c(?:a(?:che|st)|o(?:l(?:lect|umns)?|n(?:cat(?:-str)?|tains)|unt(?:-null)?)|umulative)|d(?:atepart|ecimal|rop(?:-(?:duplicates|nulls))?|ummies)|exp(?:lode|r-not)|f(?:etch|i(?:l(?:l-n(?:an|ull)|ter(?:-with)?)|rst)|latten)|g(?:et(?:-(?:day|hour|m(?:inute|onth)|nanosecond|ordinal|second|week(?:day)?|year))?|roup-by)|i(?:mplode|nt(?:eger|o-(?:df|lazy|nu))|s-(?:duplicated|in|n(?:ot-null|ull)|unique))|join|l(?:ast|it|owercase)|m(?:ax|e(?:an|dian)|in)|n(?:-unique|ot)|o(?:pen|therwise)|p(?:ivot|rofile)|qu(?:antile|ery)|r(?:e(?:name|place(?:-all)?|verse)|olling)|s(?:a(?:mple|ve)|chema|e(?:lect|t(?:-with-idx)?)|h(?:ape|ift)|lice|ort-by|t(?:d|ore-(?:get|ls|rm)|r(?:-(?:join|lengths|slice)|ftime))|um(?:mary)?)|take|u(?:n(?:ique|pivot)|ppercase)|va(?:lue-counts|r)|w(?:hen|ith-column)))?|rt)|r(?:epend|int)|s)|query(?: (?:db|git|json|web(?:page-info)?|xml))?|r(?:an(?:dom(?: (?:b(?:inary|ool)|chars|dice|float|int|uuid))?|ge)|e(?:duce|g(?:ex|istry query)|ject|name|turn|verse)|m|o(?:ll(?: (?:down|left|right|up))?|tate)|un-external)|s(?:ave|c(?:hema|ope(?: (?:aliases|commands|e(?:ngine-stats|xterns)|modules|variables))?)|e(?:lect|q(?: (?:char|date))?)|huffle|kip(?: (?:until|while))?|leep|o(?:rt(?:-by)?|urce(?:-env)?)|plit(?: (?:c(?:ell-path|hars|olumn)|list|row|words)|-by)?|t(?:art|or(?: (?:create|delete|export|i(?:mport|nsert)|open|reset|update))?|r(?: (?:c(?:a(?:mel-case|pitalize)|ontains)|d(?:istance|owncase)|e(?:nds-with|xpand)|index-of|join|kebab-case|length|pascal-case|re(?:place|verse)|s(?:creaming-snake-case|imilarity|nake-case|ta(?:rts-with|ts)|ubstring)|t(?:itle-case|rim)|upcase)|ess_internals)?)|ys(?: (?:cpu|disks|host|mem|net|temp|users))?)|t(?:a(?:ble|ke(?: (?:until|while))?)|e(?:e|rm size)|imeit|o(?: (?:csv|html|json|m(?:d|sgpack(?:z)?)|nuon|p(?:arquet|list)|t(?:ext|oml|sv)|xml|yaml)|uch)?|r(?:anspose|y)|utor)|u(?:limit|n(?:ame|iq(?:-by)?)|p(?:date(?: cells)?|sert)|rl(?: (?:build-query|decode|encode|join|parse))?|se)|v(?:alues|ersion|iew(?: (?:files|ir|s(?:ource|pan)))?)|w(?:atch|h(?:ere|i(?:ch|le)|oami)|i(?:ndow|th-env)|rap)|zip)(?![\\\\w-])( (.*))?"},{"captures":{"1":{"patterns":[{"include":"#paren-expression"}]}},"match":"(?<=\\\\^)(?:\\\\$(\\"[^\\"]+\\"|'[^']+')|\\"[^\\"]+\\"|'[^']+')","name":"entity.name.type.external.nushell"},{"captures":{"1":{"name":"entity.name.type.external.nushell"},"2":{"patterns":[{"include":"#value"}]}},"match":"([\\\\w.]+(?:-[\\\\w.!]+)*)(?: (.*))?"},{"include":"#value"}]}},"end":"(?=\\\\||\\\\)|\\\\}|;)|$","name":"meta.command.nushell","patterns":[{"include":"#parameters"},{"include":"#spread"},{"include":"#value"}]},"comment":{"match":"(#.*)$","name":"comment.nushell"},"constant-keywords":{"match":"\\\\b(?:true|false|null)\\\\b","name":"constant.language.nushell"},"constant-value":{"patterns":[{"include":"#constant-keywords"},{"include":"#datetime"},{"include":"#numbers"},{"include":"#numbers-hexa"},{"include":"#binary"}]},"control-keywords":{"comment":"Regex generated with list-to-tree (https://github.com/glcraft/list-to-tree)","match":"(?<![0-9a-zA-Z_\\\\-.\\\\/:\\\\\\\\])(?:break|continue|else(?: if)?|for|if|loop|mut|return|try|while)(?![0-9a-zA-Z_\\\\-.\\\\/:\\\\\\\\])","name":"keyword.control.nushell"},"datetime":{"match":"\\\\b\\\\d{4}-\\\\d{2}-\\\\d{2}(?:T\\\\d{2}:\\\\d{2}:\\\\d{2}(?:\\\\.\\\\d+)?(?:\\\\+\\\\d{2}:?\\\\d{2}|Z)?)?\\\\b","name":"constant.numeric.nushell"},"define-alias":{"captures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.type.nushell"},"3":{"patterns":[{"include":"#operators"}]}},"match":"((?:export )?alias)\\\\s+([\\\\w\\\\-!]+)\\\\s*(=)"},"define-variable":{"captures":{"1":{"name":"keyword.other.nushell"},"2":{"name":"variable.other.nushell"},"3":{"patterns":[{"include":"#operators"}]}},"match":"(let|mut|(?:export\\\\s+)?const)\\\\s+(\\\\w+)\\\\s+(=)"},"expression":{"patterns":[{"include":"#pre-command"},{"include":"#for-loop"},{"include":"#operators"},{"match":"\\\\|","name":"keyword.control.nushell"},{"include":"#control-keywords"},{"include":"#constant-value"},{"include":"#command"},{"include":"#value"}]},"extern":{"begin":"((?:export\\\\s+)?extern)\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\")","beginCaptures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.type.nushell"}},"end":"(?<=\\\\])","endCaptures":{"0":{"name":"punctuation.definition.function.end.nushell"}},"patterns":[{"include":"#function-parameters"}]},"for-loop":{"begin":"(for)\\\\s+(\\\\$?\\\\w+)\\\\s+(in)\\\\s+(.+)\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"keyword.other.nushell"},"2":{"name":"variable.other.nushell"},"3":{"name":"keyword.other.nushell"},"4":{"patterns":[{"include":"#value"}]},"5":{"name":"punctuation.section.block.begin.bracket.curly.nushell"}},"end":"\\\\}","endCaptures":{"0":{"name":"punctuation.section.block.end.bracket.curly.nushell"}},"name":"meta.for-loop.nushell","patterns":[{"include":"source.nushell"}]},"function":{"begin":"((?:export\\\\s+)?def(?:\\\\s+--\\\\w+)*)\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+'|\`[\\\\w\\\\- ]+\`)(\\\\s+--\\\\w+)*","beginCaptures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.type.nushell"},"3":{"name":"entity.name.function.nushell"}},"end":"(?<=\\\\})","patterns":[{"include":"#function-parameters"},{"include":"#function-body"},{"include":"#function-inout"}]},"function-body":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.function.begin.nushell"}},"end":"\\\\}","endCaptures":{"0":{"name":"punctuation.definition.function.end.nushell"}},"name":"meta.function.body.nushell","patterns":[{"include":"source.nushell"}]},"function-inout":{"patterns":[{"include":"#types"},{"match":"->","name":"keyword.operator.nushell"},{"include":"#function-multiple-inout"}]},"function-multiple-inout":{"begin":"(?<=]\\\\s*)(:)\\\\s+(\\\\[)","beginCaptures":{"1":{"name":"punctuation.definition.in-out.nushell"},"2":{"name":"meta.brace.square.begin.nushell"}},"end":"\\\\]","endCaptures":{"0":{"name":"meta.brace.square.end.nushell"}},"patterns":[{"include":"#types"},{"captures":{"1":{"name":"punctuation.separator.nushell"}},"match":"\\\\s*(,)\\\\s*"},{"captures":{"1":{"name":"keyword.operator.nushell"}},"match":"\\\\s+(->)\\\\s+"}]},"function-parameter":{"patterns":[{"captures":{"1":{"name":"keyword.control.nushell"}},"match":"(-{0,2}|\\\\.{3})[\\\\w-]+(?:\\\\((-[\\\\w?])\\\\))?","name":"variable.parameter.nushell"},{"begin":"\\\\??:\\\\s*","end":"(?=(?:\\\\s+(?:-{0,2}|\\\\.{3})[\\\\w-]+)|(?:\\\\s*(?:,|\\\\]|\\\\||@|=|#|$)))","patterns":[{"include":"#types"}]},{"begin":"@(?=\\"|')","end":"(?<=\\"|')","patterns":[{"include":"#string"}]},{"begin":"=\\\\s*","end":"(?=(?:\\\\s+-{0,2}[\\\\w-]+)|(?:\\\\s*(?:,|\\\\]|\\\\||#|$)))","name":"default.value.nushell","patterns":[{"include":"#value"}]}]},"function-parameters":{"begin":"\\\\[","beginCaptures":{"0":{"name":"meta.brace.square.begin.nushell"}},"end":"\\\\]","endCaptures":{"0":{"name":"meta.brace.square.end.nushell"}},"name":"meta.function.parameters.nushell","patterns":[{"include":"#function-parameter"},{"include":"#comment"}]},"internal-variables":{"match":"\\\\$(?:nu|env)\\\\b","name":"variable.language.nushell"},"keyword":{"match":"(?:def(?:-env)?)","name":"keyword.other.nushell"},"module":{"begin":"((?:export\\\\s+)?module)\\\\s+([\\\\w\\\\-]+)\\\\s*\\\\{","beginCaptures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.namespace.nushell"}},"end":"\\\\}","endCaptures":{"0":{"name":"punctuation.definition.module.end.nushell"}},"name":"meta.module.nushell","patterns":[{"include":"source.nushell"}]},"numbers":{"match":"(?<![\\\\w-])[-+]?(?:\\\\d+|\\\\d{1,3}(?:_\\\\d{3})*)(?:\\\\.\\\\d*)?(?i:ns|us|ms|sec|min|hr|day|wk|b|kb|mb|gb|tb|pt|eb|zb|kib|mib|gib|tib|pit|eib|zib)?(?:(?![\\\\w.])|(?=\\\\.\\\\.))","name":"constant.numeric.nushell"},"numbers-hexa":{"match":"(?<![\\\\w-])0x[0-9a-fA-F]+(?![\\\\w.])","name":"constant.numeric.nushell"},"operators":{"patterns":[{"include":"#operators-word"},{"include":"#operators-symbols"},{"include":"#ranges"}]},"operators-symbols":{"match":"(?<= )(?:(?:\\\\+|-|\\\\*|\\\\/)=?|\\\\/\\\\/|\\\\*\\\\*|!=|[<>=]=?|[!=]~|\\\\+\\\\+=?)(?= |$)","name":"keyword.control.nushell"},"operators-word":{"match":"(?<= |\\\\()(?:mod|in|not-in|not|and|or|xor|bit-or|bit-and|bit-xor|bit-shl|bit-shr|starts-with|ends-with)(?= |\\\\)|$)","name":"keyword.control.nushell"},"parameters":{"captures":{"1":{"name":"keyword.control.nushell"}},"match":"(?<=\\\\s)(-{1,2})[\\\\w-]+","name":"variable.parameter.nushell"},"paren-expression":{"begin":"\\\\(","beginCaptures":{"0":{"name":"meta.brace.round.begin.nushell"}},"end":"\\\\)","endCaptures":{"0":{"name":"meta.brace.round.end.nushell"}},"name":"meta.expression.parenthesis.nushell","patterns":[{"include":"#expression"}]},"pre-command":{"begin":"(\\\\w+)(=)","beginCaptures":{"1":{"name":"variable.other.nushell"},"2":{"patterns":[{"include":"#operators"}]}},"end":"(?=\\\\s+)","patterns":[{"include":"#value"}]},"ranges":{"match":"\\\\.\\\\.<?","name":"keyword.control.nushell"},"spread":{"match":"\\\\.\\\\.\\\\.(?=[^\\\\s\\\\]}])","name":"keyword.control.nushell"},"string":{"patterns":[{"include":"#string-single-quote"},{"include":"#string-backtick"},{"include":"#string-double-quote"},{"include":"#string-interpolated-double"},{"include":"#string-interpolated-single"},{"include":"#string-bare"}]},"string-backtick":{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.nushell"}},"end":"\`","endCaptures":{"0":{"name":"punctuation.definition.string.end.nushell"}},"name":"string.quoted.single.nushell"},"string-bare":{"match":"[^$\\\\[{(\\"',|#\\\\s|][^\\\\[\\\\]{}()\\"'\\\\s#,|]*","name":"string.bare.nushell"},"string-double-quote":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.nushell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.nushell"}},"name":"string.quoted.double.nushell","patterns":[{"match":"\\\\w+"},{"include":"#string-escape"}]},"string-escape":{"match":"\\\\\\\\(?:[bfrnt\\\\\\\\'\\"/]|u[0-9a-fA-F]{4})","name":"constant.character.escape.nushell"},"string-interpolated-double":{"begin":"\\\\$\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.nushell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.nushell"}},"name":"string.interpolated.double.nushell","patterns":[{"match":"\\\\\\\\[()]","name":"constant.character.escape.nushell"},{"include":"#string-escape"},{"include":"#paren-expression"}]},"string-interpolated-single":{"begin":"\\\\$'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.nushell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.nushell"}},"name":"string.interpolated.single.nushell","patterns":[{"include":"#paren-expression"}]},"string-single-quote":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.nushell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.nushell"}},"name":"string.quoted.single.nushell"},"table":{"begin":"\\\\[","beginCaptures":{"0":{"name":"meta.brace.square.begin.nushell"}},"end":"\\\\]","endCaptures":{"0":{"name":"meta.brace.square.end.nushell"}},"name":"meta.table.nushell","patterns":[{"include":"#spread"},{"include":"#value"},{"match":",","name":"punctuation.separator.nushell"}]},"types":{"patterns":[{"begin":"\\\\b(list)\\\\s*<","beginCaptures":{"1":{"name":"entity.name.type.nushell"}},"end":">","name":"meta.list.nushell","patterns":[{"include":"#types"}]},{"begin":"\\\\b(record)\\\\s*<","beginCaptures":{"1":{"name":"entity.name.type.nushell"}},"end":">","name":"meta.record.nushell","patterns":[{"captures":{"1":{"name":"variable.parameter.nushell"}},"match":"([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[^']+')\\\\s*:\\\\s*"},{"include":"#types"}]},{"match":"\\\\b(\\\\w+)\\\\b","name":"entity.name.type.nushell"}]},"use-module":{"patterns":[{"captures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.namespace.nushell"},"3":{"name":"keyword.other.nushell"}},"match":"^\\\\s*((?:export )?use)\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+')(?:\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+'|\\\\*))?\\\\s*;?$"},{"begin":"^\\\\s*((?:export )?use)\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+')\\\\s*\\\\[","beginCaptures":{"1":{"name":"entity.name.function.nushell"},"2":{"name":"entity.name.namespace.nushell"}},"end":"(\\\\])\\\\s*;?\\\\s*$","endCaptures":{"1":{"name":"meta.brace.square.end.nushell"}},"patterns":[{"captures":{"1":{"name":"keyword.other.nushell"}},"match":"([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+'|\\\\*),?"},{"include":"#comment"}]},{"captures":{"2":{"name":"entity.name.function.nushell"},"3":{"name":"string.bare.nushell","patterns":[{"captures":{"1":{"name":"entity.name.namespace.nushell"}},"match":"([\\\\w\\\\- ]+)(?:\\\\.nu)?(?=$|\\"|')"}]},"4":{"name":"keyword.other.nushell"}},"match":"(?<path>(?:/|\\\\\\\\|~[\\\\/\\\\\\\\]|\\\\.\\\\.?[\\\\/\\\\\\\\])?(?:[^\\\\/\\\\\\\\]+[\\\\/\\\\\\\\])*[\\\\w\\\\- ]+(?:\\\\.nu)?){0}^\\\\s*((?:export )?use)\\\\s+(\\"\\\\g<path>\\"|'\\\\g<path>\\\\'|(?![\\"'])\\\\g<path>)(?:\\\\s+([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[^']+'|\\\\*))?\\\\s*;?$"},{"begin":"(?<path>(?:/|\\\\\\\\|~[\\\\/\\\\\\\\]|\\\\.\\\\.?[\\\\/\\\\\\\\])?(?:[^\\\\/\\\\\\\\]+[\\\\/\\\\\\\\])*[\\\\w\\\\- ]+(?:\\\\.nu)?){0}^\\\\s*((?:export )?use)\\\\s+(\\"\\\\g<path>\\"|'\\\\g<path>\\\\'|(?![\\"'])\\\\g<path>)\\\\s+\\\\[","beginCaptures":{"2":{"name":"entity.name.function.nushell"},"3":{"name":"string.bare.nushell","patterns":[{"captures":{"1":{"name":"entity.name.namespace.nushell"}},"match":"([\\\\w\\\\- ]+)(?:\\\\.nu)?(?=$|\\"|')"}]}},"end":"(\\\\])\\\\s*;?\\\\s*$","endCaptures":{"1":{"name":"meta.brace.square.end.nushell"}},"patterns":[{"captures":{"0":{"name":"keyword.other.nushell"}},"match":"([\\\\w\\\\-]+|\\"[\\\\w\\\\- ]+\\"|'[\\\\w\\\\- ]+'|\\\\*),?"},{"include":"#comment"}]},{"captures":{"0":{"name":"entity.name.function.nushell"}},"match":"^\\\\s*(?:export )?use\\\\b"}]},"value":{"patterns":[{"include":"#variables"},{"include":"#variable-fields"},{"include":"#control-keywords"},{"include":"#constant-value"},{"include":"#table"},{"include":"#operators"},{"include":"#paren-expression"},{"include":"#braced-expression"},{"include":"#string"},{"include":"#comment"}]},"variable-fields":{"match":"(?<=\\\\)|\\\\}|\\\\])(?:\\\\.(?:[\\\\w-]+|\\"[\\\\w\\\\- ]+\\"))+","name":"variable.other.nushell"},"variables":{"captures":{"1":{"patterns":[{"include":"#internal-variables"},{"match":"\\\\$.+","name":"variable.other.nushell"}]},"2":{"name":"variable.other.nushell"}},"match":"(\\\\$\\\\w+)((?:\\\\.(?:[\\\\w-]+|\\"[\\\\w\\\\- ]+\\"))*)"}},"scopeName":"source.nushell","aliases":["nu"]}`));
|
|
2
2
|
var nushell = [
|
|
3
3
|
lang
|
|
4
4
|
];
|
package/dist/langs/terraform.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lang = Object.freeze(JSON.parse('{"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":"[A-Za-z][\\\\w-]*|\\\\d*","endCaptures":{"0":{"patterns":[{"comment":"Attribute name","match":"(?!null|false|true)[A-Za-z][\\\\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)[A-Za-z][0-9A-Za-z_-]*)(\\\\))?\\\\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)[A-Za-z][0-9A-Za-z_-]*\\\\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(core::)?(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"},{"match":"\\\\bprovider::[A-Za-z][\\\\w_-]*::[A-Za-z][\\\\w_-]*\\\\b","name":"support.function.provider.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":{"captures":{"1":{"name":"keyword.control.hcl"},"2":{"patterns":[{"match":"=>","name":"storage.type.function.hcl"},{"include":"#for_expression_body"}]}},"match":"(for)\\\\b(.*)\\\\n"},"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)[A-Za-z][0-9A-Za-z_-]*\\\\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)[A-Za-z][0-9A-Za-z_-]*)\\\\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":":","name":"keyword.operator.hcl"},{"match":"=>","name":"keyword.operator.hcl"}]},"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"]}'));
|
|
1
|
+
const lang = Object.freeze(JSON.parse('{"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":"[A-Za-z][\\\\w-]*|\\\\d*","endCaptures":{"0":{"patterns":[{"comment":"Attribute name","match":"(?!null|false|true)[A-Za-z][\\\\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)[A-Za-z][0-9A-Za-z_-]*)(\\\\))?\\\\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)[A-Za-z][0-9A-Za-z_-]*\\\\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"},"5":{"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(core::)?(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"},{"match":"\\\\bprovider::[A-Za-z][\\\\w_-]*::[A-Za-z][\\\\w_-]*\\\\b","name":"support.function.provider.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":{"captures":{"1":{"name":"keyword.control.hcl"},"2":{"patterns":[{"match":"=>","name":"storage.type.function.hcl"},{"include":"#for_expression_body"}]}},"match":"(for)\\\\b(.*)\\\\n"},"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)[A-Za-z][0-9A-Za-z_-]*\\\\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)[A-Za-z][0-9A-Za-z_-]*)\\\\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":":","name":"keyword.operator.hcl"},{"match":"=>","name":"keyword.operator.hcl"}]},"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
2
|
var terraform = [
|
|
3
3
|
lang
|
|
4
4
|
];
|
|
@@ -1,37 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import '@shikijs/core';
|
|
3
|
-
|
|
4
|
-
interface CssVariablesThemeOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Theme name. Need to unique if multiple css variables themes are created
|
|
7
|
-
*
|
|
8
|
-
* @default 'css-variables'
|
|
9
|
-
*/
|
|
10
|
-
name?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Prefix for css variables
|
|
13
|
-
*
|
|
14
|
-
* @default '--shiki-'
|
|
15
|
-
*/
|
|
16
|
-
variablePrefix?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Default value for css variables, the key is without the prefix
|
|
19
|
-
*
|
|
20
|
-
* @example `{ 'token-comment': '#888' }` will generate `var(--shiki-token-comment, #888)` for comments
|
|
21
|
-
*/
|
|
22
|
-
variableDefaults?: Record<string, string>;
|
|
23
|
-
/**
|
|
24
|
-
* Enable font style
|
|
25
|
-
*
|
|
26
|
-
* @default true
|
|
27
|
-
*/
|
|
28
|
-
fontStyle?: boolean;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A factory function to create a css-variable-based theme
|
|
32
|
-
*
|
|
33
|
-
* @see https://shiki.style/guide/theme-colors#css-variables-theme
|
|
34
|
-
*/
|
|
35
|
-
declare function createCssVariablesTheme(options?: CssVariablesThemeOptions): ThemeRegistration;
|
|
36
|
-
|
|
37
|
-
export { type CssVariablesThemeOptions, createCssVariablesTheme };
|
|
1
|
+
export { CssVariablesThemeOptions, createCssVariablesTheme } from '@shikijs/core';
|