Files
vscode/extensions/powershell/syntaxes/powershell.tmLanguage.json
T
Benjamin Pasero 06df95754d bring titlebarplus up to date
* Merge NPM Scripts: Added configuration option to change default click action #49282

* fix #50560

* Fix getmac test (#48804)

* Cleaning up some typos in vscode.d.ts and vscode.proposed.d.ts (#50533)

* yarn.lock changes

* grid - log serialized state if restoring failed

* Fixes #50382: Align .mtku with .detected-link

* debug issues back to isidorn

* Hide interactive playground commands from command palette (fixes #49706)

* grid - drop outline as focus indication and rely on dimmed state

* grid - allow to close empty group when closing all editors of a group

* grid - get preferredSize from grid

* Fixes #43003: Cannot specify a global problemMatcher in tasks.json

* cleanup integrated terminal support for debugging

* grid - action wording tweaks

* #45663 Use core translations asset

* grid - allow to close dirty diff editor if master is still opened in same group

* Support to run npm install from a package node

* grid - log previous UI state upon error

* grid - stronger border top color

otherwise when a tab is showing in a vertical split, the border collides with the sash border

* remove todo

* do not append logLevel

#47774

* Implement Go To Next/Previous Breakpoint editor actions

* Include enabledOnly in debug model interface

* remove from schema

#47774

* #45663 fix compilations

* change openBreakpointSource to use IBreakpoint

* return passed context if resourceOrContext is not useful

* fix off by one issue

* Simplify implementation

* return context if it has a groupId

* polish

* Fixes Microsoft/monaco-editor#891: Focus editor when returning from context menu

* go to next / previosu breakpoint minor polish

* Add Endgame for 1.24

* fix index computing for editor close case

* Fix #49145

- Enable/Disable viewlets by views when context
- Move viewlet enablement/disablement to views service
- Fix - adopt if a viewlet extension is disabled/removed

* Avoid command palette entry (#49340)

* [handlebars] code-folding algorithm is less useful than Indentation-based one. Fixes #48457

* use upper lang id

* Fixes #49378

* #49145 Store placeholder states for all viewlets

* Add `logicalLine` argument to `mutlicursor.insertBelow` and `mutlicursor.insertAbove`

* Removed duplicate loop

* eliminate code duplication; use resolveWorkspaceFolder()

* #45663 Get all asset types

* [css] update service

* [html] update services

* grid - fix compile

* add User-Id to marketplace build requests

* Improve rendererType description

Fixes #50617

* fix #50672

* Fixes #49173

* fix #50321

* fix #50670

* Install option not needed when we have Install and Restart Fixes #50669

* Fixes #50616, Showing/hiding details in Issue Reporter resets scroll position

* Fix #50642, fix #50673

* Issue reporter and process explorer windows should close when the parent window closes, fixes #50716

* Issue Reporter should clear the error state when selecting an extension, fixes #50702

* Extracting methods

* Make sure we update the webview's state on setState

* Avoid prompting for same file type in the same session #50537

* Use language name instead of locale in the prompt #50738

* Use correct failed error code for webview resource load error

* Mark unused parameter

* Restore restart

* Try serializing webviews even if they have not called setState

Fixes #50752

* Change parameter name to match interface name

Fixes #50745

* Fix non-serializable webviews being revived if they called setState

* Include recommended extensions in telemetry events to determine success

* Fix #49777 - Emmet balance In after balance out should go back to initial selection and not first child (#49996)

* Update Emmet - balance.ts

* Cover all cases

* Update prompt msg Fixes #50738

* Fix #50632

* search-rg has no icon

* EH search - replace search.enableSearchProviders with a search-rg specific setting

* fix #50742

* fix #50691

* part of #50760

* smoke: uncomment debug suite

* smoketest: use yarn

* grid - allow to close empty groups via middle click (#50733)

* careful with path comparisons on windows

related to #50760

* smoke: run yarn verbose

* fix #50710

* Improve description (#43208)

* fix #50722

* Fix #50663

* Fix #47586

* fixes #50609

* fixes #50026

* 💄

* fix  #50773

* improve perf of findId and getElementById, #50575

* don't show outline when there are more then 7500 symbols, #50575

* fix typos

* polish for #50667

* fix #50700

* grid keep sizing after branch node demotion

fixes #50564

* grid - for now remove editorGroup.activeEmptyBackground

* fix #50726

* grid: resize views when branch is demoted

fixes #50675

* fix #50727

* fix #50734

* remove preview rant from search.location

* splitview: dont propagate white-sapce property

fixes #50720

* fix #50774

* Fixes #50296

* fix  #50207

* Fixes #24670: Add API to determine if the task service supports parallel task execution.

* fix #50741

* Fixes  #49400: Cannot read property 'then' of undefined

* Fix #50717

* Fix #48901

* polish debug.toolBarLocation

fixes #50786

* Fix #50717

* missing compilation

* Fix #48225

* fix #50711

* Fix errors installing extension from Welcome page (fixes #50753)

* fixes #50794

* fixes #50787

* continuous build: use vsts npm feed

* Fix for #50792: empty pre post scripts not rendered properly

* Fix #50728

* continuous build: use vsts feed

* Fix for #50792 npm exclude doesn´t work for folder names

* Move previewOptions, #50788

* build: remove npm auth

* better fix for #50710

* Revert "Merge pull request #49790 from usernamehw/raw_settings"

This reverts commit f92a162b41, reversing
changes made to fc710af792.

* Remove unused variable

* Fix regression in C# TextMate grammar related to lambda parameters

This tweak fixes a regression recently introduced in the C# TextMate grammar around
implicitly-typed lambda parameters.

* https://github.com/dotnet/csharp-tmLanguage/issues/119
* https://github.com/dotnet/csharp-tmLanguage/issues/120

* Fix parameter not being escaped

Fixes #49057

* wip: grid.getNeighborViews

* Make sure we use normalized path for compare

Fixes #50760

(the path should already have been normalized at this point so I don't think there is any user impact)

* Clean up importModuleSpecifier wording

Fixes #50817

* Remove duplicate strings and small cleanup

* Spelling fix Ouoting -> Quoting

* Restore default settings editor keybinding

* Dont trigger emmet for # in selectors Fixes #49269

* Hide settings editor feedback button in stable

* Use better colors for markdown code blocks

* Moving webview api back to proposed for more polishing

#49022

* Shorten showUnused setting name

Fixes #50648

* fix #50678

* Don't include imports in js/ts document symbol results

Fixes #50829

* smoketest: remove verbose from yarn

* smoketest: clear state from failing search tests

* minor rename

* Fix markdown preview not setting context properly on first creation

Fixes #50558

* smoketest: update to package-lock.json

fixes #50857

* smoketest: bring back search tests

* #48901 Expand by default only in custom viewlets

* fixes #50812

* open editors: clear focus when group without editors is active

fixes #50563

* Fix MaxNumber incrementFileName bug

* Fixes #48758: Do not import standalone editor modules

* fixes #50864

* Use `MAX_SAFE_SMALL_INTEGER`

* Fixes #50858: Task api is still marked as proposed

* fixes #50737

* fix #50867

* Fix: showQuickPick keeps showing infinite progress (fixes #50863)

* Clarify for translation (fixes #50634)

* fixes #50870

* fix #50479

* grid - todo@grid => todo@ben

* grid - adopt new getNeighborViews() method

* grid - add workbench.action.closeEditorsAndGroup

* open editors: close group action

fixes #50625

* open editors: use actionRunner for contexts

fixes #50621

* [css][html] update service

* grid: getNeighborViews

* grid - adopt wrapping

* Some menu action clients (ActionBar) handle alternative actions on their own so the alternative actions should be ignored

fixes #50581

* fillInActionBarActions and fillInContextMenuActions for clarity

* Remove inconsistent use of active in terminal API

Related #48434

* Try using fixAllDescription for js/ts quick fixes

Fixes #42549

* Fixes #50828, code-insiders --status triggered exception in main process

* Pick up ts 2.9.1 final

* Fix for #50868 and #50884

* Still gray out vars even if user has disabled suggestions

Fixes #50890

* grid: fix neighbor npe issue

* grid: more getNeighborViews tests

* grid: use boundaries for neighbor finding

* grid: getNeighborViews perf

* grid: add todo

* 2018-05-31. Merged in translations from Transifex.

* Update GDPR annotation

* update message

* Add specific `refactor.move` scope for js/ts move to new file action

* Use localized language name when available

* Add proper contribution schema for ts server pluguins

#50682

* Fix extra word

* Fix #50909 - add link to new settings editor from old one

* Left-align settings editor preview prompt

* grid - fix issues with touchbar updating

* grid - use viewColumnToEditorGroup in more places

* grid - close all groups should preserve first group

* Reapply fix for #50790

* grid - assign some default keybindings for focus group

* Fixes #50763: All running Visual Studio code instances shutdown all at once

* grid - 💄

* fixes #50926

* show alternative actions when alt is pressed, not only on mouse over

* open editors: click on groups should activate them

* update description (for #50677)

* Fix #50835

* grid - tweak some groups access order

* one more time, fix #50321

* beware of keybinding command null arguments

fixes #50821

* grid - prevent multiple confirmation dialogs for the same editor to show up (for  #50539)

* smoketest: go-to-definition is flaky

fixes #50944
fixes #49107

* Fixes #50943: TSC version 2.9.x in watch mode prints different end compile message

* grid - fix bad === for editors

* 💄 grid, cleanup getViews()

* Update distro commit and third party notices

* Use localizedLanguageName instead of languageNameLocalized which doesnt exist

* Remove now unneeded any

* Make sure unused diags are still updated when suggestions are disabled

Fixes #50890

* Fix unused var

* Update version

* Update issue templates, #49380

* Fix #50893 - escape regex chars when copy search string from editor

* Fix #50985 - don't take editor text when toggling search details
2018-06-04 10:44:46 -07:00

1000 lines
26 KiB
JSON

{
"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."
],
"version": "https://github.com/PowerShell/EditorSyntax/commit/529562fbe4ba9abde22282ee8b00141284968f4b",
"name": "PowerShell",
"scopeName": "source.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": "#interpolatedStringContent"
},
{
"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"
},
{
"begin": "(?<!')'",
"end": "'(?!')",
"name": "string.quoted.single.powershell",
"patterns": [
{
"match": "''",
"name": "constant.character.escape.powershell"
}
]
},
{
"begin": "\\@\"(?=$)",
"end": "^\"@",
"name": "string.quoted.double.heredoc.powershell",
"patterns": [
{
"include": "#variableNoProperty"
},
{
"include": "#doubleQuotedStringEscapes"
},
{
"include": "#interpolation"
}
]
},
{
"begin": "\\@'(?=$)",
"end": "^'@",
"name": "string.quoted.single.heredoc.powershell",
"patterns": [
{
"match": "''",
"name": "constant.character.escape.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.variable.definition.powershell"
},
"2": {
"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": "(?<!\\w)-([ci]?[lg][te]|eq|ne)",
"name": "keyword.operator.logical.powershell"
},
{
"match": "(\\b(([A-Za-z0-9\\-_\\.]+)\\.(?i:exe|com|cmd|bat))\\b)",
"name": "support.function.powershell"
},
{
"match": "(?<!\\w|-)((?i:begin|break|catch|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|foreach(?!-object)|from|if|in|inlinescript|parallel|param|process|return|switch|throw|trap|try|until|var|where(?!-object)|while)|%|\\?)(?!\\w)",
"name": "keyword.control.powershell"
},
{
"match": "(?<!\\w)(--%)(?!\\w)",
"name": "keyword.control.powershell"
},
{
"comment": "This should only be relevant inside a class but will require a rework of how classes are matched. This is a temp fix.",
"match": "(?<!\\w)((?i:hidden|static))(?!\\w)",
"name": "storage.modifier.powershell"
},
{
"captures": {
"1": {
"name": "storage.type.powershell"
},
"2": {
"name": "entity.name.function"
}
},
"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"
},
{
"match": "(?<!\\w)-(?i:is(?:not)?|as)\\b",
"name": "keyword.operator.comparison.powershell"
},
{
"match": "(?<!\\w)-(?i:[ic]?(?:eq|ne|[gl][te]|(?:not)?(?:like|match|contains|in)|replace))(?!\\p{L})",
"name": "keyword.operator.comparison.powershell"
},
{
"match": "(?<!\\w)-(?i:join|split)(?!\\p{L})|!",
"name": "keyword.operator.unary.powershell"
},
{
"match": "(?<!\\w)-(?i:and|or|not|xor)(?!\\p{L})|!",
"name": "keyword.operator.logical.powershell"
},
{
"match": "(?<!\\w)-(?i:band|bor|bnot|bxor)(?!\\p{L})",
"name": "keyword.operator.bitwise.powershell"
},
{
"match": "(?<!\\w)-(?i:f)(?!\\p{L})",
"name": "keyword.operator.string-format.powershell"
},
{
"match": "[+%*/-]?=|[+/*%-]",
"name": "keyword.operator.assignment.powershell"
},
{
"match": "\\|{2}|&{2}|;",
"name": "keyword.other.statement-separator.powershell"
},
{
"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": {
"commentLine": {
"begin": "(?<![`\\\\-])#",
"captures": {
"0": {
"name": "punctuation.definition.comment.powershell"
}
},
"end": "$",
"name": "comment.line.powershell",
"patterns": [
{
"include": "#commentEmbeddedDocs"
},
{
"include": "#RequiresDirective"
}
]
},
"attribute": {
"begin": "(\\[)\\s*\\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength)\\b",
"beginCaptures": {
"1": {
"name": "punctuation.section.bracket.begin.powershell"
},
"2": {
"name": "support.function.attribute.powershell"
}
},
"end": "(\\])",
"endCaptures": {
"1": {
"name": "punctuation.section.bracket.end.powershell"
}
},
"name": "meta.attribute.powershell",
"patterns": [
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.powershell"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.powershell"
}
},
"patterns": [
{
"include": "#variable"
},
{
"include": "#variableNoProperty"
},
{
"include": "#hashtable"
},
{
"include": "#scriptblock"
},
{
"include": "#doubleQuotedStringEscapes"
},
{
"include": "#doubleQuotedString"
},
{
"include": "#type"
},
{
"include": "#numericConstant"
},
{
"include": "#doubleQuotedString"
},
{
"include": "$self"
},
{
"match": "(?i)\\b(mandatory|valuefrompipeline|valuefrompipelinebypropertyname|valuefromremainingarguments|position|parametersetname|defaultparametersetname|supportsshouldprocess|positionalbinding|helpuri|confirmimpact|helpmessage)\\b(?:\\s+)?(=)",
"captures": {
"1": {
"name": "variable.parameter.attribute.powershell"
},
"2": {
"name": "keyword.operator.assignment.powershell"
}
}
},
{
"begin": "(?<!')'",
"end": "'(?!')",
"name": "string.quoted.single.powershell",
"patterns": [
{
"match": "''",
"name": "constant.character.escape.powershell"
}
]
}
]
}
]
},
"commands": {
"patterns": [
{
"comment": "Verb-Noun pattern:",
"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",
"name": "support.function.powershell"
},
{
"comment": "Builtin cmdlets with reserved verbs",
"match": "(?<!\\w)(?i:foreach-object)(?!\\w)",
"name": "support.function.powershell"
},
{
"comment": "Builtin cmdlets with reserved verbs",
"match": "(?<!\\w)(?i:where-object)(?!\\w)",
"name": "support.function.powershell"
},
{
"comment": "Builtin cmdlets with reserved verbs",
"match": "(?<!\\w)(?i:sort-object)(?!\\w)",
"name": "support.function.powershell"
},
{
"comment": "Builtin cmdlets with reserved verbs",
"match": "(?<!\\w)(?i:tee-object)(?!\\w)",
"name": "support.function.powershell"
}
]
},
"commentEmbeddedDocs": {
"patterns": [
{
"captures": {
"1": {
"name": "constant.string.documentation.powershell"
},
"2": {
"name": "keyword.operator.documentation.powershell"
}
},
"match": "(?i:\\s*(\\.)(COMPONENT|DESCRIPTION|EXAMPLE|EXTERNALHELP|FORWARDHELPCATEGORY|FORWARDHELPTARGETNAME|FUNCTIONALITY|INPUTS|LINK|NOTES|OUTPUTS|REMOTEHELPRUNSPACE|ROLE|SYNOPSIS))",
"name": "comment.documentation.embedded.powershell"
},
{
"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"
}
]
},
"doubleQuotedStringEscapes": {
"patterns": [
{
"match": "`[0abnfrvt\"'$`]",
"name": "constant.character.escape.powershell"
},
{
"match": "\"\"",
"name": "constant.character.escape.powershell"
}
]
},
"function": {
"begin": "^(?:\\s*+)(?i)(function|filter|configuration|workflow)\\s+(?:(global|local|script|private):)?((?:\\p{L}|\\d|_|-|\\.)+)",
"beginCaptures": {
"0": {
"name": "meta.function.powershell"
},
"1": {
"name": "storage.type.powershell"
},
"2": {
"name": "storage.modifier.scope.powershell"
},
"3": {
"name": "entity.name.function.powershell"
}
},
"end": "(?=\\{|\\()",
"patterns": [
{
"include": "#commentLine"
}
]
},
"interpolatedStringContent": {
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.powershell"
}
},
"contentName": "interpolated.simple.source.powershell",
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.powershell"
}
},
"patterns": [
{
"include": "$self"
},
{
"include": "#interpolation"
},
{
"include": "#interpolatedStringContent"
}
]
},
"interpolation": {
"begin": "(\\$)(\\()",
"beginCaptures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "punctuation.section.group.begin.powershell"
}
},
"contentName": "interpolated.complex.source.powershell",
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.powershell"
}
},
"patterns": [
{
"include": "$self"
},
{
"include": "#interpolation"
},
{
"include": "#interpolatedStringContent"
}
]
},
"numericConstant": {
"patterns": [
{
"captures": {
"1": {
"name": "constant.numeric.hex.powershell"
},
"2": {
"name": "keyword.other.powershell"
}
},
"match": "(?<!\\w)([-+]?0(?:x|X)[0-9a-fA-F_]+(?:U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[kmgtp]b)?)\\b"
},
{
"captures": {
"1": {
"name": "constant.numeric.integer.powershell"
},
"2": {
"name": "keyword.other.powershell"
}
},
"match": "(?<!\\w)([-+]?(?:[0-9_]+)?\\.[0-9_]+(?:(?:e|E)[0-9]+)?(?:F|f|D|d|M|m)?)((?i:[kmgtp]b)?)\\b"
},
{
"captures": {
"1": {
"name": "constant.numeric.octal.powershell"
},
"2": {
"name": "keyword.other.powershell"
}
},
"match": "(?<!\\w)([-+]?0(?:b|B)[01_]+(?:U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[kmgtp]b)?)\\b"
},
{
"captures": {
"1": {
"name": "constant.numeric.integer.powershell"
},
"2": {
"name": "keyword.other.powershell"
}
},
"match": "(?<!\\w)([-+]?[0-9_]+(?:e|E)(?:[0-9_])?+(?:F|f|D|d|M|m)?)((?i:[kmgtp]b)?)\\b"
},
{
"captures": {
"1": {
"name": "constant.numeric.integer.powershell"
},
"2": {
"name": "keyword.other.powershell"
}
},
"match": "(?<!\\w)([-+]?[0-9_]+\\.(?:e|E)(?:[0-9_])?+(?:F|f|D|d|M|m)?)((?i:[kmgtp]b)?)\\b"
},
{
"captures": {
"1": {
"name": "constant.numeric.integer.powershell"
},
"2": {
"name": "keyword.other.powershell"
}
},
"match": "(?<!\\w)([-+]?[0-9_]+[\\.]?(?:F|f|D|d|M|m))((?i:[kmgtp]b)?)\\b"
},
{
"captures": {
"1": {
"name": "constant.numeric.integer.powershell"
},
"2": {
"name": "keyword.other.powershell"
}
},
"match": "(?<!\\w)([-+]?[0-9_]+[\\.]?(?:U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[kmgtp]b)?)\\b"
}
]
},
"scriptblock": {
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.braces.begin.powershell"
}
},
"end": "\\}",
"endCaptures": {
"0": {
"name": "punctuation.section.braces.end.powershell"
}
},
"name": "meta.scriptblock.powershell",
"patterns": [
{
"include": "$self"
}
]
},
"type": {
"begin": "\\[",
"beginCaptures": {
"0": {
"name": "punctuation.section.bracket.begin.powershell"
}
},
"end": "\\]",
"endCaptures": {
"0": {
"name": "punctuation.section.bracket.end.powershell"
}
},
"patterns": [
{
"match": "(?!\\d+|\\.)(?:\\p{L}|\\p{N}|\\.)+",
"name": "storage.type.powershell"
},
{
"include": "$self"
}
]
},
"variable": {
"patterns": [
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "constant.language.powershell"
}
},
"comment": "These are special constants.",
"match": "(\\$)(?i:(False|Null|True))\\b"
},
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"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))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?\\b"
},
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "support.constant.automatic.powershell"
},
"3": {
"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.variable.definition.powershell"
},
"2": {
"name": "variable.language.powershell"
},
"3": {
"name": "entity.name.function.invocation.powershell"
}
},
"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"
},
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "storage.modifier.scope.powershell"
},
"3": {
"name": "variable.other.readwrite.powershell"
},
"4": {
"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.variable.definition.powershell"
},
"2": {
"name": "punctuation.section.braces.begin.powershell"
},
"3": {
"name": "storage.modifier.scope.powershell"
},
"4": {
"name": "variable.other.readwrite.powershell"
},
"5": {
"name": "punctuation.section.braces.end.powershell"
},
"6": {
"name": "entity.name.function.invocation.powershell"
}
},
"match": "(?i:(\\$)(\\{)(global|local|private|script|using|workflow):([^}]*[^}`])(\\}))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
},
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "support.variable.drive.powershell"
},
"3": {
"name": "variable.other.readwrite.powershell"
},
"4": {
"name": "entity.name.function.invocation.powershell"
}
},
"match": "(?i:(\\$|@)((?:\\p{L}|\\d|_)+:)?((?:\\p{L}|\\d|_)+))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
},
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "punctuation.section.braces.begin.powershell"
},
"3": {
"name": "support.variable.drive.powershell"
},
"4": {
"name": "variable.other.readwrite.powershell"
},
"5": {
"name": "punctuation.section.braces.end.powershell"
},
"6": {
"name": "entity.name.function.invocation.powershell"
}
},
"match": "(?i:(\\$)(\\{)((?:\\p{L}|\\d|_)+:)?([^}]*[^}`])(\\}))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
}
]
},
"UsingDirective": {
"match": "(?<!\\w)(?i:(using))\\s+(?i:(namespace|module))\\s+(?i:((?:\\w+(?:\\.)?)+))",
"captures": {
"1": {
"name": "keyword.control.using.powershell"
},
"2": {
"name": "keyword.other.powershell"
},
"3": {
"name": "variable.parameter.powershell"
}
}
},
"RequiresDirective": {
"begin": "(?<=#)(?i:(requires))\\s",
"beginCaptures": {
"0": {
"name": "keyword.control.requires.powershell"
}
},
"end": "$",
"name": "meta.requires.powershell",
"patterns": [
{
"match": "\\-(?i:Modules|PSSnapin|RunAsAdministrator|ShellId|Version)",
"name": "keyword.other.powershell"
},
{
"match": "(?<!-)\\b\\p{L}+|\\d+(?:\\.\\d+)*",
"name": "variable.parameter.powershell"
},
{
"include": "#hashtable"
}
]
},
"variableNoProperty": {
"patterns": [
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "constant.language.powershell"
}
},
"comment": "These are special constants.",
"match": "(\\$)(?i:(False|Null|True))\\b"
},
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"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.variable.definition.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.variable.definition.powershell"
},
"2": {
"name": "variable.language.powershell"
},
"3": {
"name": "entity.name.function.invocation.powershell"
}
},
"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"
},
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "storage.modifier.scope.powershell"
},
"3": {
"name": "variable.other.readwrite.powershell"
},
"4": {
"name": "entity.name.function.invocation.powershell"
}
},
"match": "(?i:(\\$|@)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))"
},
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "storage.modifier.scope.powershell"
},
"3": {
"name": "variable.other.readwrite.powershell"
},
"4": {
"name": "keyword.other.powershell"
},
"5": {
"name": "entity.name.function.invocation.powershell"
}
},
"match": "(?i:(\\$)(\\{)(global|local|private|script|using|workflow):([^}]*[^}`])(\\}))"
},
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "support.variable.drive.powershell"
},
"3": {
"name": "variable.other.readwrite.powershell"
},
"4": {
"name": "entity.name.function.invocation.powershell"
}
},
"match": "(?i:(\\$)((?:\\p{L}|\\d|_)+:)?((?:\\p{L}|\\d|_)+))"
},
{
"captures": {
"1": {
"name": "keyword.other.variable.definition.powershell"
},
"2": {
"name": "punctuation.section.braces.begin"
},
"3": {
"name": "support.variable.drive.powershell"
},
"4": {
"name": "variable.other.readwrite.powershell"
},
"5": {
"name": "punctuation.section.braces.end"
}
},
"match": "(?i:(\\$)(\\{)((?:\\p{L}|\\d|_)+:)?([^}]*[^}`])(\\}))"
}
]
},
"hashtable": {
"begin": "(@)(\\{)",
"beginCaptures": {
"1": {
"name": "keyword.other.hashtable.begin.powershell"
},
"2": {
"name": "punctuation.section.braces.begin.powershell"
}
},
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.braces.end.powershell"
}
},
"name": "meta.hashtable.powershell",
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.string.begin.powershell"
},
"2": {
"name": "variable.other.readwrite.powershell"
},
"3": {
"name": "punctuation.definition.string.end.powershell"
},
"4": {
"name": "keyword.operator.assignment.powershell"
}
},
"match": "\\b((?:\\'|\\\")?)(\\w+)((?:\\'|\\\")?)(?:\\s+)?(=)(?:\\s+)?",
"name": "meta.hashtable.assignment.powershell"
},
{
"include": "#scriptblock"
},
{
"include": "$self"
}
]
},
"doubleQuotedString": {
"begin": "(?<!(?<!`)\")\"",
"end": "\"(?!\")",
"name": "string.quoted.double.powershell",
"patterns": [
{
"match": "(?i)\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,64}\\b"
},
{
"include": "#variableNoProperty"
},
{
"include": "#variable"
},
{
"include": "#doubleQuotedStringEscapes"
},
{
"include": "#interpolation"
},
{
"match": "`\\s*$",
"name": "keyword.other.powershell"
}
]
}
}
}