const lang = Object.freeze({ "displayName": "PowerShell", "name": "powershell", "patterns": [{ "begin": "<#", "beginCaptures": { "0": { "name": "punctuation.definition.comment.block.begin.powershell" } }, "end": "#>", "endCaptures": { "0": { "name": "punctuation.definition.comment.block.end.powershell" } }, "name": "comment.block.powershell", "patterns": [{ "include": "#commentEmbeddedDocs" }] }, { "match": "[2-6]>&1|>>|>|<<|<|>|>\\||[1-6]>|[1-6]>>", "name": "keyword.operator.redirection.powershell" }, { "include": "#commands" }, { "include": "#commentLine" }, { "include": "#variable" }, { "include": "#subexpression" }, { "include": "#function" }, { "include": "#attribute" }, { "include": "#UsingDirective" }, { "include": "#type" }, { "include": "#hashtable" }, { "include": "#doubleQuotedString" }, { "include": "#scriptblock" }, { "comment": "Needed to parse stuff correctly in 'argument mode'. (See about_parsing.)", "include": "#doubleQuotedStringEscapes" }, { "applyEndPatternLast": true, "begin": "['\\x{2018}-\\x{201B}]", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.powershell" } }, "end": "['\\x{2018}-\\x{201B}]", "endCaptures": { "0": { "name": "punctuation.definition.string.end.powershell" } }, "name": "string.quoted.single.powershell", "patterns": [{ "match": "['\\x{2018}-\\x{201B}]{2}", "name": "constant.character.escape.powershell" }] }, { "begin": '(@["\\x{201C}-\\x{201E}])\\s*$', "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.powershell" } }, "end": '^["\\x{201C}-\\x{201E}]@', "endCaptures": { "0": { "name": "punctuation.definition.string.end.powershell" } }, "name": "string.quoted.double.heredoc.powershell", "patterns": [{ "include": "#variableNoProperty" }, { "include": "#doubleQuotedStringEscapes" }, { "include": "#interpolation" }] }, { "begin": "(@['\\x{2018}-\\x{201B}])\\s*$", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.powershell" } }, "end": "^['\\x{2018}-\\x{201B}]@", "endCaptures": { "0": { "name": "punctuation.definition.string.end.powershell" } }, "name": "string.quoted.single.heredoc.powershell" }, { "include": "#numericConstant" }, { "begin": "(@)(\\()", "beginCaptures": { "1": { "name": "keyword.other.array.begin.powershell" }, "2": { "name": "punctuation.section.group.begin.powershell" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.group.end.powershell" } }, "name": "meta.group.array-expression.powershell", "patterns": [{ "include": "$self" }] }, { "begin": "((\\$))(\\()", "beginCaptures": { "1": { "name": "keyword.other.substatement.powershell" }, "2": { "name": "punctuation.definition.subexpression.powershell" }, "3": { "name": "punctuation.section.group.begin.powershell" } }, "comment": "TODO: move to repo; make recursive.", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.group.end.powershell" } }, "name": "meta.group.complex.subexpression.powershell", "patterns": [{ "include": "$self" }] }, { "match": "(\\b(([A-Za-z0-9\\-_\\.]+)\\.(?i:exe|com|cmd|bat))\\b)", "name": "support.function.powershell" }, { "match": "(?{1,5})}", "name": "constant.character.escape.powershell" }, { "match": "`u(?:\\{[0-9a-fA-F]{,6}.)?", "name": "invalid.character.escape.powershell" }] }, "variable": { "patterns": [{ "captures": { "0": { "name": "constant.language.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" } }, "comment": "These are special constants.", "match": "(\\$)(?i:(False|Null|True))\\b" }, { "captures": { "0": { "name": "support.constant.variable.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "3": { "name": "variable.other.member.powershell" } }, "comment": "These are the other built-in constants.", "match": "(\\$)(?i:(Error|ExecutionContext|Host|Home|PID|PsHome|PsVersionTable|ShellID))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?\\b" }, { "captures": { "0": { "name": "support.variable.automatic.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "3": { "name": "variable.other.member.powershell" } }, "comment": "Automatic variables are not constants, but they are read-only. In monokai (default) color schema support.variable doesn't have color, so we use constant.", "match": "(\\$)((?:[$^?])|(?i:_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This)\\b)((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?" }, { "captures": { "0": { "name": "variable.language.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "3": { "name": "variable.other.member.powershell" } }, "comment": "Style preference variables as language variables so that they stand out.", "match": "(\\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|InformationPreference|LogCommandHealthEvent|LogCommandLifecycleEvent|LogEngineHealthEvent|LogEngineLifecycleEvent|LogProviderHealthEvent|LogProviderLifecycleEvent|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|PSCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoLoadingPreference|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|ProgressPreference|VerbosePreference|WarningPreference|WhatIfPreference))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?\\b" }, { "captures": { "0": { "name": "variable.other.readwrite.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "2": { "name": "storage.modifier.scope.powershell" }, "4": { "name": "variable.other.member.powershell" } }, "match": "(?i:(\\$|@)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?" }, { "captures": { "0": { "name": "variable.other.readwrite.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "2": { "name": "punctuation.section.braces.begin.powershell" }, "3": { "name": "storage.modifier.scope.powershell" }, "5": { "name": "punctuation.section.braces.end.powershell" }, "6": { "name": "variable.other.member.powershell" } }, "match": "(?i:(\\$)(\\{)(global|local|private|script|using|workflow):([^}]*[^}`])(\\}))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?" }, { "captures": { "0": { "name": "variable.other.readwrite.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "2": { "name": "support.variable.drive.powershell" }, "4": { "name": "variable.other.member.powershell" } }, "match": "(?i:(\\$|@)((?:\\p{L}|\\d|_)+:)?((?:\\p{L}|\\d|_)+))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?" }, { "captures": { "0": { "name": "variable.other.readwrite.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "2": { "name": "punctuation.section.braces.begin.powershell" }, "3": { "name": "support.variable.drive.powershell" }, "5": { "name": "punctuation.section.braces.end.powershell" }, "6": { "name": "variable.other.member.powershell" } }, "match": "(?i:(\\$)(\\{)((?:\\p{L}|\\d|_)+:)?([^}]*[^}`])(\\}))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?" }] }, "variableNoProperty": { "patterns": [{ "captures": { "0": { "name": "constant.language.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" } }, "comment": "These are special constants.", "match": "(\\$)(?i:(False|Null|True))\\b" }, { "captures": { "0": { "name": "support.constant.variable.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "3": { "name": "variable.other.member.powershell" } }, "comment": "These are the other built-in constants.", "match": "(\\$)(?i:(Error|ExecutionContext|Host|Home|PID|PsHome|PsVersionTable|ShellID))\\b" }, { "captures": { "0": { "name": "support.variable.automatic.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "3": { "name": "variable.other.member.powershell" } }, "comment": "Automatic variables are not constants, but they are read-only...", "match": "(\\$)((?:[$^?])|(?i:_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This)\\b)" }, { "captures": { "0": { "name": "variable.language.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "3": { "name": "variable.other.member.powershell" } }, "comment": "Style preference variables as language variables so that they stand out.", "match": "(\\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|InformationPreference|LogCommandHealthEvent|LogCommandLifecycleEvent|LogEngineHealthEvent|LogEngineLifecycleEvent|LogProviderHealthEvent|LogProviderLifecycleEvent|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|PSCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoLoadingPreference|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|ProgressPreference|VerbosePreference|WarningPreference|WhatIfPreference))\\b" }, { "captures": { "0": { "name": "variable.other.readwrite.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "2": { "name": "storage.modifier.scope.powershell" }, "4": { "name": "variable.other.member.powershell" } }, "match": "(?i:(\\$)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))" }, { "captures": { "0": { "name": "variable.other.readwrite.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "2": { "name": "storage.modifier.scope.powershell" }, "4": { "name": "keyword.other.powershell" }, "5": { "name": "variable.other.member.powershell" } }, "match": "(?i:(\\$)(\\{)(global|local|private|script|using|workflow):([^}]*[^}`])(\\}))" }, { "captures": { "0": { "name": "variable.other.readwrite.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "2": { "name": "support.variable.drive.powershell" }, "4": { "name": "variable.other.member.powershell" } }, "match": "(?i:(\\$)((?:\\p{L}|\\d|_)+:)?((?:\\p{L}|\\d|_)+))" }, { "captures": { "0": { "name": "variable.other.readwrite.powershell" }, "1": { "name": "punctuation.definition.variable.powershell" }, "2": { "name": "punctuation.section.braces.begin" }, "3": { "name": "support.variable.drive.powershell" }, "5": { "name": "punctuation.section.braces.end" } }, "match": "(?i:(\\$)(\\{)((?:\\p{L}|\\d|_)+:)?([^}]*[^}`])(\\}))" }] } }, "scopeName": "source.powershell", "aliases": ["ps", "ps1"] }); var powershell = [ lang ]; export { powershell as default };