@@ -147,7 +147,7 @@ contexts:
147 2: keyword.other.powershell
147 2: keyword.other.powershell
148 3: variable.parameter.powershell
148 3: variable.parameter.powershell
149 attribute:
149 attribute:
150− - match: '(\[)\s*\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength)\b'
150+ - match: '(\[)\s*\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength|supportswildcards)\b'
151 captures:
151 captures:
152 1: punctuation.section.bracket.begin.powershell
152 1: punctuation.section.bracket.begin.powershell
153 2: support.function.attribute.powershell
153 2: support.function.attribute.powershell
@@ -165,31 +165,11 @@ contexts:
165 captures:
165 captures:
166 0: punctuation.section.group.end.powershell
166 0: punctuation.section.group.end.powershell
167 pop: true
167 pop: true
169− - include: variableNoProperty
170− - include: hashtable
171− - include: scriptblock
172− - include: doubleQuotedStringEscapes
173− - include: doubleQuotedString
175− - include: numericConstant
176− - include: doubleQuotedString
177 - include: main
168 - include: main
178 - match: (?i)\b(mandatory|valuefrompipeline|valuefrompipelinebypropertyname|valuefromremainingarguments|position|parametersetname|defaultparametersetname|supportsshouldprocess|supportspaging|positionalbinding|helpuri|confirmimpact|helpmessage)\b(?:\s+)?(=)?
169 - match: (?i)\b(mandatory|valuefrompipeline|valuefrompipelinebypropertyname|valuefromremainingarguments|position|parametersetname|defaultparametersetname|supportsshouldprocess|supportspaging|positionalbinding|helpuri|confirmimpact|helpmessage)\b(?:\s+)?(=)?
179 captures:
170 captures:
180 1: variable.parameter.attribute.powershell
171 1: variable.parameter.attribute.powershell
181 2: keyword.operator.assignment.powershell
172 2: keyword.operator.assignment.powershell
184− 0: punctuation.definition.string.begin.powershell
186− - meta_scope: string.quoted.single.powershell
189− 0: punctuation.definition.string.end.powershell
192− scope: constant.character.escape.powershell
193 commands:
173 commands:
194 - match: '(?:(\p{L}|\d|_|-|\\|\:)*\\)?\b(?i:Add|Approve|Assert|Backup|Block|Build|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Deploy|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'
174 - match: '(?:(\p{L}|\d|_|-|\\|\:)*\\)?\b(?i:Add|Approve|Assert|Backup|Block|Build|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Deploy|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'
195 comment: "Verb-Noun pattern:"
175 comment: "Verb-Noun pattern:"
@@ -242,14 +222,14 @@ contexts:
242 pop: true
222 pop: true
243 - match: '(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,64}\b'
223 - match: '(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,64}\b'
244 - include: variableNoProperty
224 - include: variableNoProperty
246 - include: doubleQuotedStringEscapes
225 - include: doubleQuotedStringEscapes
247 - include: interpolation
226 - include: interpolation
248 - match: '`\s*$'
227 - match: '`\s*$'
249 scope: keyword.other.powershell
228 scope: keyword.other.powershell
250 doubleQuotedStringEscapes:
229 doubleQuotedStringEscapes:
251− - match: '`[0abnfrvt"''$`]'
230+ - match: '`[`0abefnrtv"''$]'
252 scope: constant.character.escape.powershell
231 scope: constant.character.escape.powershell
232+ - include: unicodeEscape
253 - match: '""'
233 - match: '""'
254 scope: constant.character.escape.powershell
234 scope: constant.character.escape.powershell
255 function:
235 function:
@@ -362,6 +342,11 @@ contexts:
362 - match: '(?!\d+|\.)(?:\p{L}|\p{N}|\.)+'
342 - match: '(?!\d+|\.)(?:\p{L}|\p{N}|\.)+'
363 scope: storage.type.powershell
343 scope: storage.type.powershell
364 - include: main
344 - include: main
346+ - match: '`u\{(?:(?:10)?([0-9a-fA-F]){1,4}|0?\g<1>{1,5})}'
347+ scope: constant.character.escape.powershell
348+ - match: '`u(?:\{[0-9a-fA-F]{,6}.)?'
349+ scope: invalid.character.escape.powershell
365 variable:
350 variable:
366 - match: (\$)(?i:(False|Null|True))\b
351 - match: (\$)(?i:(False|Null|True))\b
367 comment: These are special constants.
352 comment: These are special constants.
@@ -374,13 +359,13 @@ contexts:
374 0: support.constant.variable.powershell
359 0: support.constant.variable.powershell
375 1: punctuation.definition.variable.powershell
360 1: punctuation.definition.variable.powershell
376 3: variable.other.member.powershell
361 3: variable.other.member.powershell
377− - 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'
362+ - 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)?'
378 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.
363 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.
379 captures:
364 captures:
380− 0: support.constant.automatic.powershell
365+ 0: support.variable.automatic.powershell
381 1: punctuation.definition.variable.powershell
366 1: punctuation.definition.variable.powershell
382 3: variable.other.member.powershell
367 3: variable.other.member.powershell
383− - 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'
368+ - 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'
384 comment: Style preference variables as language variables so that they stand out.
369 comment: Style preference variables as language variables so that they stand out.
385 captures:
370 captures:
386 0: variable.language.powershell
371 0: variable.language.powershell
@@ -426,19 +411,19 @@ contexts:
426 0: support.constant.variable.powershell
411 0: support.constant.variable.powershell
427 1: punctuation.definition.variable.powershell
412 1: punctuation.definition.variable.powershell
428 3: variable.other.member.powershell
413 3: variable.other.member.powershell
429− - 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
414+ - 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)'
430 comment: Automatic variables are not constants, but they are read-only...
415 comment: Automatic variables are not constants, but they are read-only...
431 captures:
416 captures:
432 0: support.variable.automatic.powershell
417 0: support.variable.automatic.powershell
433 1: punctuation.definition.variable.powershell
418 1: punctuation.definition.variable.powershell
434 3: variable.other.member.powershell
419 3: variable.other.member.powershell
435− - 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
420+ - 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
436 comment: Style preference variables as language variables so that they stand out.
421 comment: Style preference variables as language variables so that they stand out.
437 captures:
422 captures:
438 0: variable.language.powershell
423 0: variable.language.powershell
439 1: punctuation.definition.variable.powershell
424 1: punctuation.definition.variable.powershell
440 3: variable.other.member.powershell
425 3: variable.other.member.powershell
441− - match: '(?i:(\$|@)(global|local|private|script|using|workflow):((?:\p{L}|\d|_)+))'
426+ - match: '(?i:(\$)(global|local|private|script|using|workflow):((?:\p{L}|\d|_)+))'
442 captures:
427 captures:
443 0: variable.other.readwrite.powershell
428 0: variable.other.readwrite.powershell
444 1: punctuation.definition.variable.powershell
429 1: punctuation.definition.variable.powershell