2018-02-09 09:55:16 +00:00
{
"information_for_contributors" : [
"This file has been converted from https://github.com/PowerShell/EditorSyntax/blob/master/PowerShellSyntax.tmLanguage" ,
"If you want to provide a fix or improvement, please create a pull request against the original repository." ,
"Once accepted there, we are happy to receive an update request."
] ,
2018-02-27 10:57:41 +00:00
"version" : "https://github.com/PowerShell/EditorSyntax/commit/90e4b5454f2f1cc06eae4c6c8e12c33d9f5f3a8c" ,
2018-02-09 09:55:16 +00:00
"name" : "PowerShell" ,
2018-02-12 15:54:35 +00:00
"scopeName" : "source.powershell" ,
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"begin" : "<#" ,
2018-02-09 09:55:16 +00:00
"beginCaptures" : {
2018-02-27 10:57:41 +00:00
"0" : {
"name" : "punctuation.start.definition.comment.block.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"end" : "#>" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.end.definition.comment.block.powershell"
}
} ,
"name" : "comment.block.powershell" ,
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"include" : "#commentEmbeddedDocs"
2018-02-09 09:55:16 +00:00
}
]
} ,
{
2018-02-27 10:57:41 +00:00
"begin" : "(?<![`\\\\-])#" ,
"end" : "$" ,
"name" : "comment.line.number-sign.powershell" ,
"patterns" : [
{
"include" : "#commentEmbeddedDocs"
}
]
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"match" : "[2-6]>&1|>>|>|<<|<|>|>\\||[1-6]>|[1-6]>>" ,
"name" : "keyword.operator.redirection.powershell"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"include" : "#commands"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"include" : "#variable"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"include" : "#interpolatedStringContent"
2018-02-09 09:55:16 +00:00
} ,
{
"include" : "#function"
} ,
{
2018-02-27 10:57:41 +00:00
"include" : "#attribute"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"include" : "#type"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"begin" : "(?<!(?<!`)\")\"" ,
"end" : "\"(?!\")" ,
"name" : "string.quoted.double.powershell" ,
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"include" : "#variableNoProperty"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"include" : "#doubleQuotedStringEscapes"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"include" : "#interpolation"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"match" : "`\\s*$" ,
"name" : "keyword.other.powershell"
2018-02-09 09:55:16 +00:00
}
]
} ,
2018-02-27 10:57:41 +00:00
{
"comment" : "Needed to parse stuff correctly in 'argument mode'. (See about_parsing.)" ,
"include" : "#doubleQuotedStringEscapes"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"begin" : "(?<!')'" ,
"end" : "'(?!')" ,
"name" : "string.quoted.single.powershell" ,
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"match" : "''" ,
"name" : "constant.character.escape.powershell"
2018-02-09 09:55:16 +00:00
}
]
} ,
2018-02-27 10:57:41 +00:00
{
"begin" : "\\@\"(?=$)" ,
"end" : "^\"@" ,
"name" : "string.quoted.double.heredoc.powershell" ,
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"include" : "#variableNoProperty"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"include" : "#doubleQuotedStringEscapes"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"include" : "#interpolation"
2018-02-09 09:55:16 +00:00
}
]
} ,
2018-02-27 10:57:41 +00:00
{
"begin" : "\\@'(?=$)" ,
"end" : "^'@" ,
"name" : "string.quoted.single.heredoc.powershell" ,
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"match" : "''" ,
"name" : "constant.character.escape.powershell"
2018-02-09 09:55:16 +00:00
}
]
} ,
2018-02-27 10:57:41 +00:00
{
"include" : "#numericConstant"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"begin" : "@\\(" ,
2018-02-09 09:55:16 +00:00
"captures" : {
"0" : {
"name" : "keyword.other.powershell"
}
} ,
2018-02-27 10:57:41 +00:00
"end" : "\\)" ,
"name" : "meta.group.array-expression.powershell" ,
"patterns" : [
{
"include" : "$self"
}
]
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"begin" : "\\$\\(" ,
2018-02-09 09:55:16 +00:00
"captures" : {
2018-02-27 10:57:41 +00:00
"0" : {
"name" : "keyword.other.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"comment" : "TODO: move to repo; make recursive." ,
"end" : "\\)" ,
"name" : "meta.group.complex.subexpression.powershell" ,
"patterns" : [
{
"include" : "$self"
}
]
} ,
{
"match" : "(?<!\\w)-([ci]?[lg][te]|eq|ne)" ,
"name" : "keyword.operator.logical.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "(\\b(([A-Za-z0-9\\-_\\.]+)\\.(?i:exe|com|cmd|bat))\\b)" ,
2018-02-09 09:55:16 +00:00
"name" : "support.function.powershell"
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "(?<!\\w)((?i:begin|break|catch|continue|data|define|do|dynamicparam|else|elseif|end|exit|finally|for|foreach(?!-object)|from|if|in|inlinescript|parallel|param|process|return|switch|throw|trap|try|until|using|var|where(?!-object)|while)|%|\\?)(?!\\w)" ,
"name" : "keyword.control.powershell"
} ,
{
"captures" : {
2018-02-09 09:55:16 +00:00
"1" : {
2018-02-27 10:57:41 +00:00
"name" : "storage.type.powershell"
2018-02-09 09:55:16 +00:00
} ,
"2" : {
2018-02-27 10:57:41 +00:00
"name" : "entity.name.function"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"comment" : "capture should be entity.name.type, but it doesn't provide a good color in the default schema." ,
"match" : "(?<!\\w)((?i:class)|%|\\?)(?:\\s)+((?:\\p{L}|\\d|_|-|)+)\\b"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "(?<!\\w)-(?i:is(?:not)?|as)\\b" ,
"name" : "keyword.operator.comparison.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "(?<!\\w)-(?i:[ic]?(?:eq|ne|[gl][te]|(?:not)?(?:like|match|contains|in)|replace))(?!\\p{L})" ,
"name" : "keyword.operator.comparison.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "(?<!\\w)-(?i:join|split)(?!\\p{L})|!" ,
"name" : "keyword.operator.unary.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "(?<!\\w)-(?i:and|or|not|xor)(?!\\p{L})|!" ,
"name" : "keyword.operator.logical.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "(?<!\\w)-(?i:band|bor|bnot|bxor)(?!\\p{L})" ,
"name" : "keyword.operator.bitwise.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "(?<!\\w)-(?i:f)(?!\\p{L})" ,
"name" : "keyword.operator.string-format.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "[+%*/-]?=|[+/*%-]" ,
"name" : "keyword.operator.assignment.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "\\|{2}|&{2}|;" ,
"name" : "keyword.other.statement-separator.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
{
"match" : "&|(?<!\\w)\\.(?= )|`|,|\\|" ,
"name" : "keyword.operator.other.powershell"
} ,
{
"comment" : "This is very imprecise, is there a syntax for 'must come after...' " ,
"match" : "(?<!\\s|^)\\.\\.(?=\\d|\\(|\\$)" ,
"name" : "keyword.operator.range.powershell"
}
] ,
"repository" : {
"attribute" : {
"begin" : "\\[(\\p{L}|\\.|``\\d+)+(?=\\()" ,
"beginCaptures" : {
"0" : {
"name" : "entity.name.tag"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
"1" : {
"name" : "entity.name.tag"
}
} ,
"end" : "\\]" ,
"endCaptures" : {
"0" : {
"name" : "entity.name.tag"
}
} ,
"patterns" : [
2018-02-09 09:55:16 +00:00
{
2018-02-27 10:57:41 +00:00
"begin" : "\\(" ,
"end" : "\\)" ,
"name" : "entity.other.attribute-name" ,
"patterns" : [
{
"captures" : {
"0" : {
"name" : "entity.other.attribute.parameter.powershell"
} ,
"1" : {
"name" : "constant.language.powershell"
} ,
"2" : {
"name" : "variable.other.powershell"
}
} ,
"comment" : "really we should match the known attributes first" ,
"match" : "(\\w+)\\s*=?([^\"']*?|'[^']*?'|\"[^\"]*?\")?(?=,|\\))" ,
"name" : "entity.other.attribute-name.powershell"
} ,
{
"include" : "#variable"
}
]
2018-02-09 09:55:16 +00:00
}
]
} ,
2018-02-27 10:57:41 +00:00
"commands" : {
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"comment" : "Verb-Noun pattern:" ,
"match" : "(?:(\\p{L}|\\d|_|-|\\\\|\\:)*\\\\)?\\b(?i:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Mount|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Write)\\-.+?(?:\\.(?i:exe|cmd|bat|ps1))?\\b" ,
"name" : "support.function.powershell"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"comment" : "Builtin cmdlets with reserved verbs" ,
"match" : "(?<!\\w)(?i:foreach-object)(?!\\w)" ,
"name" : "support.function.powershell"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"comment" : "Builtin cmdlets with reserved verbs" ,
"match" : "(?<!\\w)(?i:where-object)(?!\\w)" ,
"name" : "support.function.powershell"
2018-02-09 09:55:16 +00:00
}
]
} ,
2018-02-27 10:57:41 +00:00
"commentEmbeddedDocs" : {
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"captures" : {
"1" : {
"name" : "constant.string.documentation.powershell"
} ,
"2" : {
"name" : "keyword.operator.documentation.powershell"
}
} ,
"match" : "(?i:\\s*(\\.)(SYNOPSIS|DESCRIPTION|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|FUNCTIONALITY))" ,
"name" : "comment.documentation.embedded.powershell"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"captures" : {
"1" : {
"name" : "constant.string.documentation.powershell"
} ,
"2" : {
"name" : "keyword.operator.documentation.powershell"
} ,
"3" : {
"name" : "keyword.operator.documentation.powershell"
}
} ,
"match" : "(?i:\\s*(\\.)(PARAMETER|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP)\\s+([a-z0-9-_]+))" ,
"name" : "comment.documentation.embedded.powershell"
2018-02-09 09:55:16 +00:00
} ,
{
2018-02-27 10:57:41 +00:00
"captures" : {
"1" : {
"name" : "constant.string.documentation.powershell"
} ,
"2" : {
"name" : "keyword.operator.documentation.powershell"
} ,
"3" : {
"name" : "string.quoted.double.heredoc.powershell"
}
} ,
"match" : "(?i:requires\\s+-(Version\\s+\\d(.\\d+)?|Assembly\\s+(.*)|Module\\s+(.*)|PsSnapIn\\s+(.*)|ShellId\\s+(.*)))" ,
"name" : "comment.documentation.embedded.powershell"
2018-02-09 09:55:16 +00:00
}
]
} ,
2018-02-27 10:57:41 +00:00
"doubleQuotedStringEscapes" : {
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"match" : "`[0abnfrvt\"'$`]" ,
2018-02-09 09:55:16 +00:00
"name" : "constant.character.escape.powershell"
} ,
{
2018-02-27 10:57:41 +00:00
"match" : "\"\"" ,
2018-02-09 09:55:16 +00:00
"name" : "constant.character.escape.powershell"
}
]
} ,
2018-02-27 10:57:41 +00:00
"function" : {
"begin" : "(?<!\\S)(?i)(function|filter|configuration|workflow)\\s+(?:(global|local|script|private):)?((?:\\p{L}|\\d|_|-|\\.)+)" ,
"beginCaptures" : {
"0" : {
"name" : "meta.function"
} ,
"1" : {
"name" : "storage.type"
} ,
"2" : {
"name" : "storage.modifier.scope.powershell"
} ,
"3" : {
"name" : "entity.name.function.powershell"
2018-02-09 09:55:16 +00:00
}
2018-02-27 10:57:41 +00:00
} ,
"end" : "\\{|\\("
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
"interpolatedStringContent" : {
"begin" : "\\(" ,
"beginCaptures" : {
"0" : {
"name" : "keyword.other.powershell"
}
} ,
"contentName" : "interpolated.simple.source.powershell" ,
"end" : "\\)" ,
"endCaptures" : {
"0" : {
"name" : "keyword.other.powershell"
}
} ,
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"include" : "$self"
} ,
{
"include" : "#interpolation"
} ,
{
"include" : "#interpolatedStringContent"
2018-02-09 09:55:16 +00:00
}
]
} ,
2018-02-27 10:57:41 +00:00
"interpolation" : {
"begin" : "(\\$)\\(" ,
"beginCaptures" : {
"0" : {
"name" : "keyword.other.powershell"
}
} ,
"contentName" : "interpolated.complex.source.powershell" ,
"end" : "\\)" ,
"endCaptures" : {
2018-02-09 09:55:16 +00:00
"0" : {
"name" : "keyword.other.powershell"
}
} ,
"patterns" : [
{
"include" : "$self"
} ,
{
2018-02-27 10:57:41 +00:00
"include" : "#interpolation"
} ,
{
"include" : "#interpolatedStringContent"
2018-02-09 09:55:16 +00:00
}
]
} ,
2018-02-27 10:57:41 +00:00
"numericConstant" : {
2018-02-09 09:55:16 +00:00
"patterns" : [
{
"captures" : {
"1" : {
2018-02-27 10:57:41 +00:00
"name" : "keyword.operator.math.powershell"
2018-02-09 09:55:16 +00:00
} ,
"2" : {
2018-02-27 10:57:41 +00:00
"name" : "support.constant.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
"3" : {
"name" : "keyword.other.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"match" : "(?<!\\w)(?i:(0x)([a-f0-9]+)((?i:L)?(?i:[kmgtp]b)?))(?!\\w)" ,
"name" : "constant.numeric.hexadecimal.powershell"
2018-02-09 09:55:16 +00:00
} ,
{
"captures" : {
"1" : {
2018-02-27 10:57:41 +00:00
"name" : "support.constant.powershell"
2018-02-09 09:55:16 +00:00
} ,
"2" : {
2018-02-27 10:57:41 +00:00
"name" : "keyword.operator.math.powershell"
2018-02-09 09:55:16 +00:00
} ,
"3" : {
2018-02-27 10:57:41 +00:00
"name" : "support.constant.powershell"
} ,
"4" : {
"name" : "keyword.other.powershell"
} ,
"5" : {
"name" : "keyword.other.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"match" : "(?<!\\w)(?i:(\\d*\\.?\\d+)(?:((?i:E)[+-]?)(\\d+))?((?i:[DL])?)((?i:[kmgtp]b)?))(?!\\w)" ,
"name" : "constant.numeric.scientific.powershell"
}
]
} ,
"scriptblock" : {
"begin" : "\\{" ,
"end" : "\\}" ,
"name" : "meta.scriptblock.powershell" ,
"patterns" : [
{
"include" : "$self"
2018-02-09 09:55:16 +00:00
}
]
} ,
"type" : {
"begin" : "\\[" ,
"beginCaptures" : {
"0" : {
2018-02-27 10:57:41 +00:00
"name" : "entity.other.attribute-name"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"comment" : "name should be entity.name.type but default schema doesn't have a good color for it" ,
"end" : "\\]" ,
2018-02-09 09:55:16 +00:00
"endCaptures" : {
2018-02-27 10:57:41 +00:00
"0" : {
"name" : "entity.other.attribute-name"
2018-02-09 09:55:16 +00:00
}
} ,
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"match" : "(\\p{L}|\\.|``\\d+)+?" ,
"name" : "entity.other.attribute-name"
2018-02-09 09:55:16 +00:00
} ,
{
"include" : "$self"
}
]
} ,
"variable" : {
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
"name" : "constant.language.powershell"
}
} ,
"comment" : "These are special constants." ,
"match" : "(\\$)(?i:(False|Null|True))\\b"
2018-02-09 09:55:16 +00:00
} ,
{
"captures" : {
"1" : {
2018-02-27 10:57:41 +00:00
"name" : "keyword.other.powershell"
2018-02-09 09:55:16 +00:00
} ,
"2" : {
2018-02-27 10:57:41 +00:00
"name" : "support.constant.variable.powershell"
2018-02-09 09:55:16 +00:00
} ,
"3" : {
2018-02-27 10:57:41 +00:00
"name" : "entity.name.function.invocation.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"comment" : "These are the other built-in constants." ,
"match" : "(\\$)(?i:(Error|ExecutionContext|Host|Home|PID|PsHome|PsVersionTable|ShellID))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?\\b"
2018-02-09 09:55:16 +00:00
} ,
{
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
2018-02-27 10:57:41 +00:00
"name" : "support.constant.automatic.powershell"
2018-02-09 09:55:16 +00:00
} ,
"3" : {
2018-02-27 10:57:41 +00:00
"name" : "entity.name.function.invocation.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))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?\\b"
} ,
{
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
"2" : {
"name" : "variable.language.powershell"
2018-02-09 09:55:16 +00:00
} ,
2018-02-27 10:57:41 +00:00
"3" : {
"name" : "entity.name.function.invocation.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"comment" : "Style preference variables as language variables so that they stand out." ,
"match" : "(\\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|ProgressPreference|PsCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|VerbosePreference|WarningPreference|WhatIfPreference))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?\\b"
2018-02-09 09:55:16 +00:00
} ,
{
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
2018-02-27 10:57:41 +00:00
"name" : "storage.modifier.scope.powershell"
2018-02-09 09:55:16 +00:00
} ,
"3" : {
2018-02-27 10:57:41 +00:00
"name" : "variable.other.normal.powershell"
2018-02-09 09:55:16 +00:00
} ,
"4" : {
2018-02-27 10:57:41 +00:00
"name" : "entity.name.function.invocation.powershell"
}
} ,
"match" : "(?i:(\\$)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
} ,
{
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
"name" : "storage.modifier.scope.powershell"
} ,
"3" : {
2018-02-09 09:55:16 +00:00
"name" : "variable.other.readwrite.powershell"
} ,
2018-02-27 10:57:41 +00:00
"4" : {
"name" : "keyword.other.powershell"
} ,
2018-02-09 09:55:16 +00:00
"5" : {
2018-02-27 10:57:41 +00:00
"name" : "entity.name.function.invocation.powershell"
}
} ,
"match" : "(?i:(\\$\\{)(global|local|private|script|using|workflow):([^}]*[^}`])(\\}))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
} ,
{
"captures" : {
"1" : {
2018-02-09 09:55:16 +00:00
"name" : "keyword.other.powershell"
} ,
2018-02-27 10:57:41 +00:00
"2" : {
"name" : "support.variable.drive.powershell"
} ,
"3" : {
"name" : "variable.other.readwrite.powershell"
} ,
"4" : {
"name" : "entity.name.function.invocation.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"match" : "(?i:(\\$)((?:\\p{L}|\\d|_)+:)?((?:\\p{L}|\\d|_)+))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
2018-02-09 09:55:16 +00:00
} ,
{
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
2018-02-27 10:57:41 +00:00
"name" : "support.variable.drive.powershell"
} ,
"3" : {
2018-02-09 09:55:16 +00:00
"name" : "variable.other.readwrite.powershell"
2018-02-27 10:57:41 +00:00
} ,
"4" : {
"name" : "keyword.other.powershell"
} ,
"5" : {
"name" : "entity.name.function.invocation.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"match" : "(?i:(\\$\\{)((?:\\p{L}|\\d|_)+:)?([^}]*[^}`])(\\}))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
2018-02-09 09:55:16 +00:00
}
]
} ,
2018-02-27 10:57:41 +00:00
"variableNoProperty" : {
2018-02-09 09:55:16 +00:00
"patterns" : [
{
2018-02-27 10:57:41 +00:00
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
"name" : "constant.language.powershell"
}
} ,
"comment" : "These are special constants." ,
"match" : "(\\$)(?i:(False|Null|True))\\b"
2018-02-09 09:55:16 +00:00
} ,
{
"captures" : {
"1" : {
2018-02-27 10:57:41 +00:00
"name" : "keyword.other.powershell"
2018-02-09 09:55:16 +00:00
} ,
"2" : {
2018-02-27 10:57:41 +00:00
"name" : "support.constant.variable.powershell"
} ,
"3" : {
"name" : "entity.name.function.invocation.powershell"
}
} ,
"comment" : "These are the other built-in constants." ,
"match" : "(\\$)(?i:(Error|ExecutionContext|Host|Home|PID|PsHome|PsVersionTable|ShellID))\\b"
} ,
{
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
"name" : "support.variable.automatic.powershell"
} ,
"3" : {
"name" : "entity.name.function.invocation.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" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
"name" : "variable.language.powershell"
} ,
"3" : {
"name" : "entity.name.function.invocation.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"comment" : "Style preference variables as language variables so that they stand out." ,
"match" : "(\\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|ProgressPreference|PsCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|VerbosePreference|WarningPreference|WhatIfPreference))\\b"
2018-02-09 09:55:16 +00:00
} ,
{
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
"name" : "storage.modifier.scope.powershell"
} ,
"3" : {
2018-02-27 10:57:41 +00:00
"name" : "variable.other.normal.powershell"
2018-02-09 09:55:16 +00:00
} ,
"4" : {
2018-02-27 10:57:41 +00:00
"name" : "entity.name.function.invocation.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"match" : "(?i:(\\$)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))"
2018-02-09 09:55:16 +00:00
} ,
{
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
2018-02-27 10:57:41 +00:00
"name" : "storage.modifier.scope.powershell"
2018-02-09 09:55:16 +00:00
} ,
"3" : {
2018-02-27 10:57:41 +00:00
"name" : "variable.other.readwrite.powershell"
2018-02-09 09:55:16 +00:00
} ,
"4" : {
2018-02-27 10:57:41 +00:00
"name" : "keyword.other.powershell"
2018-02-09 09:55:16 +00:00
} ,
"5" : {
2018-02-27 10:57:41 +00:00
"name" : "entity.name.function.invocation.powershell"
}
} ,
"match" : "(?i:(\\$\\{)(global|local|private|script|using|workflow):([^}]*[^}`])(\\}))"
} ,
{
"captures" : {
"1" : {
2018-02-09 09:55:16 +00:00
"name" : "keyword.other.powershell"
2018-02-27 10:57:41 +00:00
} ,
"2" : {
"name" : "support.variable.drive.powershell"
} ,
"3" : {
"name" : "variable.other.readwrite.powershell"
} ,
"4" : {
"name" : "entity.name.function.invocation.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"match" : "(?i:(\\$)((?:\\p{L}|\\d|_)+:)?((?:\\p{L}|\\d|_)+))"
2018-02-09 09:55:16 +00:00
} ,
{
"captures" : {
"1" : {
"name" : "keyword.other.powershell"
} ,
"2" : {
2018-02-27 10:57:41 +00:00
"name" : "support.variable.drive.powershell"
} ,
"3" : {
2018-02-09 09:55:16 +00:00
"name" : "variable.other.readwrite.powershell"
2018-02-27 10:57:41 +00:00
} ,
"4" : {
"name" : "keyword.other.powershell"
} ,
"5" : {
"name" : "entity.name.function.invocation.powershell"
2018-02-09 09:55:16 +00:00
}
} ,
2018-02-27 10:57:41 +00:00
"match" : "(?i:(\\$\\{)((?:\\p{L}|\\d|_)+:)?([^}]*[^}`])(\\}))"
2018-02-09 09:55:16 +00:00
}
]
}
2018-02-12 15:54:35 +00:00
}
2018-02-09 09:55:16 +00:00
}