latest WIP
This commit is contained in:
42
Sublime/PowerShell/Support/Comments.tmPreferences
Normal file
42
Sublime/PowerShell/Support/Comments.tmPreferences
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Comments</string>
|
||||
<key>scope</key>
|
||||
<string>source.powershell</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>shellVariables</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>TM_COMMENT_START</string>
|
||||
<key>value</key>
|
||||
<string># </string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>TM_COMMENT_START_2</string>
|
||||
<key>value</key>
|
||||
<string><#</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>TM_COMMENT_END_2</string>
|
||||
<key>value</key>
|
||||
<string>#></string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>TM_COMMENT_DISABLE_INDENT_2</string>
|
||||
<key>value</key>
|
||||
<string>yes</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>06532840-4879-11df-9879-0800200c9a66</string>
|
||||
</dict>
|
||||
</plist>
|
4
Sublime/PowerShell/Support/Powershell.sublime-build
Normal file
4
Sublime/PowerShell/Support/Powershell.sublime-build
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"cmd": ["powershell.exe", "-noprofile", "-file", "$file"],
|
||||
"selector": "source.powershell"
|
||||
}
|
392
Sublime/PowerShell/Support/PowershellSyntax.JSON-tmLanguage
Normal file
392
Sublime/PowerShell/Support/PowershellSyntax.JSON-tmLanguage
Normal file
@@ -0,0 +1,392 @@
|
||||
{
|
||||
"fileTypes": ["ps1", "psm1", "psd1"],
|
||||
"name": "Powershell v2",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "<#",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.start.definition.comment.block.powershell"
|
||||
}
|
||||
},
|
||||
"end": "#>",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.end.definition.comment.block.powershell"
|
||||
}
|
||||
},
|
||||
"name": "comment.block.powershell",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#commentEmbeddedDocs"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<![\\\\-])#",
|
||||
"end": "$",
|
||||
"name": "comment.line.powershell",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#commentEmbeddedDocs"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#variable"
|
||||
},
|
||||
{
|
||||
"include": "#scriptblock"
|
||||
},
|
||||
{
|
||||
"begin": "(?<!(?<!`)\")\"",
|
||||
"end": "\"(?!\")",
|
||||
"name": "string.quoted.double.powershell",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variable"
|
||||
},
|
||||
{
|
||||
"include": "#doubleQuotedStringEscapes"
|
||||
},
|
||||
{
|
||||
"include": "#interpolation"
|
||||
},
|
||||
{
|
||||
"match": "`\\s*$",
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ "include": "#doubleQuotedStringEscapes",
|
||||
"comment": "Needed to parse stuff correctly in 'argument mode'. (See about_parsing.)"
|
||||
},
|
||||
{
|
||||
"begin": "(?<!')'",
|
||||
"end": "'(?!')",
|
||||
"name": "string.quoted.single.powershell",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "''",
|
||||
"name": "constant.character.escape.powershell"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "@\"$",
|
||||
"end": "^\"@",
|
||||
"name": "string.quoted.double.heredoc.powershell",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#interpolation"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "@\\(",
|
||||
"captures": {
|
||||
"0": {
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"name": "meta.group.array-expression.powershell",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\$\\(",
|
||||
"captures": {
|
||||
"0": {
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
},
|
||||
"comment": "TODO: move to repo; make recursive.",
|
||||
"end": "\\)",
|
||||
"name": "meta.group.complex.subexpression.powershell",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "@'$",
|
||||
"end": "^'@$",
|
||||
"name": "string.quoted.double.heredoc.powershell"
|
||||
},
|
||||
{
|
||||
"include": "#numericConstant"
|
||||
},
|
||||
{
|
||||
"match": "-([lg][te]|[ci]?(eq|ne))",
|
||||
"name": "keyword.operator.logical.powershell"
|
||||
},
|
||||
{
|
||||
"include": "#PSDefaults"
|
||||
},
|
||||
{
|
||||
"match": "(?i:[a-z][a-z0-9]+-[a-z][a-z0-9]+)",
|
||||
"name": "support.function.powershell"
|
||||
},
|
||||
{
|
||||
"match": "\\b(?i:if|else|elseif|switch|while|default|try|finally|catch|for|do|until|break|continue|foreach|return|filter|in|trap|throw|param|begin|process|end|function|global|local|private|script|contained)\\b",
|
||||
"name": "keyword.control.powershell"
|
||||
},
|
||||
{
|
||||
"match": "-(?i:(?:[ic]?eq|ne|[gl][te]|(?:not)?(?:like|match|contains)|replace)|is(?:not)?|as|and|or|band|bor|not|f)\\b",
|
||||
"name": "keyword.operator.comparison.powershell"
|
||||
},
|
||||
{
|
||||
"match": "-(?i:and|or|not)|!",
|
||||
"name": "keyword.operator.logical.powershell"
|
||||
},
|
||||
{
|
||||
"match": "-(?i:f|band|bor|-bnot)\\b",
|
||||
"name": "keyword.operator.bitwise.powershell"
|
||||
},
|
||||
{
|
||||
"match": "-f\\b",
|
||||
"name": "keyword.operator.string-format.powershell"
|
||||
},
|
||||
{
|
||||
"match": "[+%*/-]?=|[+/*%-]",
|
||||
"name": "keyword.operator.assignment.powershell"
|
||||
},
|
||||
{
|
||||
"match": "2>&1|>>|>|<<|<|>|>\\||2>|2>>|1>>",
|
||||
"name": "keyword.operator.redirection.powershell"
|
||||
},
|
||||
{
|
||||
"match": "\\|{2}|&{2}|;",
|
||||
"name": "keyword.other.statement-separator.powershell"
|
||||
},
|
||||
{
|
||||
"match": "&|(?<!\\w)\\.(?= )|`|,|\\|",
|
||||
"name": "keyword.operator.other.powershell"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"PSDefaults": {
|
||||
"comment": "Default commandlets in Powershell v2",
|
||||
"match": "Disconnect-(WSMan)|Exit-(PSSession)|Copy-(Item|ItemProperty)|Resolve-(Path)|Group-(Object)|Remove-(Computer|Event|EventLog|Item|ItemProperty|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|Variable|WmiObject|WSManInstance)|Unregister-(Event|PSSessionConfiguration)|Tee-(Object)|Pop-(Location)|Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item|ItemProperty|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance|WSManInstance|WSManQuickConfig)|Format-(Custom|List|Table|Wide)|Invoke-(Command|Expression|History|Item|WmiMethod|WSManAction)|Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)|Update-(FormatData|List|TypeData)|Sort-(Object)|Measure-(Command|Object)|ForEach-(Object)|Connect-(WSMan)|Suspend-(Service)|ConvertFrom-(Csv|SecureString|StringData)|Where-(Object)|Rename-(Item|ItemProperty)|Convert-(Path)|Select-(Object|String|Xml)|Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)|Stop-(Computer|Job|Process|Service|Transcript)|New-(Alias|Event|EventLog|Item|ItemProperty|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionOption|Service|TimeSpan|Variable|WebServiceProxy|WSManInstance|WSManSessionOption)|Resume-(Service)|Show-(EventLog)|Out-(Default|File|GridView|Host|Null|Printer|String)|Undo-(Transaction)|Trace-(Command)|Clear-(Content|EventLog|History|Item|ItemProperty|Variable)|Push-(Location)|Split-(Path)|Disable-(ComputerRestore|PSBreakpoint|PSSessionConfiguration|WSManCredSSP)|Reset-(ComputerMachinePassword)|Restore-(Computer)|ConvertTo-(Csv|Html|SecureString|Xml)|Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration|WSManCredSSP)|Join-(Path)|Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)|Compare-(Object)|Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|Counter|Credential|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|UICulture|Unique|Variable|WinEvent|WmiObject|WSManCredSSP|WSManInstance)|Receive-(Job)|Move-(Item|ItemProperty)|Add-(Computer|Content|History|Member|PSSnapin|Type)|Wait-(Event|Job|Process)|Send-(MailMessage)|Read-(Host)|Complete-(Transaction)|Checkpoint-(Computer)|Debug-(Process)|Use-(Transaction)|Restart-(Computer|Service)|Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)|Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|WSMan)|Start-(Job|Process|Service|Sleep|Transaction|Transcript)|Limit-(EventLog)|Enter-(PSSession)",
|
||||
"name": "support.function.builtin.powershell"
|
||||
},
|
||||
"commentEmbeddedDocs": {
|
||||
"patterns": [
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
},
|
||||
"interpolatedStringContent": {
|
||||
"begin": "\\(",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
},
|
||||
"contentName": "interpolated.simple.source.powershell",
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
},
|
||||
{
|
||||
"include": "#interpolation"
|
||||
},
|
||||
{
|
||||
"include": "#interpolatedStringContent"
|
||||
}
|
||||
]
|
||||
},
|
||||
"interpolation": {
|
||||
"begin": "(\\$)\\(",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
},
|
||||
"contentName": "interpolated.complex.source.powershell",
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
},
|
||||
{
|
||||
"include": "#interpolation"
|
||||
},
|
||||
{
|
||||
"include": "#interpolatedStringContent"
|
||||
}
|
||||
]
|
||||
},
|
||||
"numericConstant": {
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "support.constant.powershell"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.operator.math.powershell"
|
||||
},
|
||||
"3": {
|
||||
"name": "support.constant.powershell"
|
||||
},
|
||||
"4": {
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
},
|
||||
"match": "(?i:\\d+(E)(\\+|\\-)\\d+(d)?(mb|kb|gb)?)",
|
||||
"name": "constant.numeric.scientific.powershell"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "support.constant.powershell"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
},
|
||||
"match": "(?i:(0x)[a-f0-9]+(mb|kb|gb)?)",
|
||||
"name": "constant.numeric.hexadecimal.powershell"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "support.constant.powershell"
|
||||
},
|
||||
"2": {
|
||||
"name": "support.constant.powershell"
|
||||
},
|
||||
"3": {
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
},
|
||||
"match": "\\d*(?<!\\.)(\\.)\\d+(d)?(mb|kb|gb)?",
|
||||
"name": "constant.numeric.double.powershell"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "support.constant.powershell"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.other.powershell"
|
||||
}
|
||||
},
|
||||
"match": "(?<!\\w)\\d+(d)?(mb|kb|gb)?(?!\\w)",
|
||||
"name": "constant.numeric.powershell"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scriptblock": {
|
||||
"begin": "\\{",
|
||||
"end": "\\}",
|
||||
"name": "meta.scriptblock.powershell",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
"variable": {
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.other.powershell"
|
||||
},
|
||||
"2": {
|
||||
"name": "constant.numeric.powershell"
|
||||
}
|
||||
},
|
||||
"comment": "Style var name as numeric constant so that they stand out.",
|
||||
"match": "(\\$)(?i:(\\$|\\?|\\^|args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext|false|FormatEnumerationLimit|HOME|Host|input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|null|OutputEncoding|PID|PROFILE|ProgressPreference|PSBoundParameters|PSCulture|PSEmailServer|PSHOME|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|PWD|ReportErrorShowExceptionClass|ReportErrorShowInnerException|ReportErrorShowSource|ReportErrorShowStackTrace|ShellId|StackTrace|true|VerbosePreference|WarningPreference|WhatIfPreference))\\b",
|
||||
"name": "support.variable.builtin.powershell"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.other.variable.powershell"
|
||||
},
|
||||
"2": {
|
||||
"name": "storage.modifier.scope.powershell"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.other.readwrite.powershell"
|
||||
}
|
||||
},
|
||||
"match": "(?i:(\\$)(?:(private|script|global):)?([a-z0-9_]+))"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.other.variable.powershell"
|
||||
},
|
||||
"2": {
|
||||
"name": "variable.other.readwrite.powershell"
|
||||
},
|
||||
"3": {
|
||||
"name": "storage.modifier.scope.powershell"
|
||||
}
|
||||
},
|
||||
"match": "(?i:(\\$)(\\{(?:(private|script|global):)?.+?\\}))"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scopeName": "source.powershell",
|
||||
"uuid": "f8f5ffb0-503e-11df-9879-0800200c9a66"
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"word_wrap": false,
|
||||
"translate_tabs_to_spaces": true
|
||||
}
|
615
Sublime/PowerShell/Support/PowershellSyntax.tmLanguage
Normal file
615
Sublime/PowerShell/Support/PowershellSyntax.tmLanguage
Normal file
@@ -0,0 +1,615 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>ps1</string>
|
||||
<string>psm1</string>
|
||||
<string>psd1</string>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>Powershell v2</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string><#</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.start.definition.comment.block.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>#></string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.end.definition.comment.block.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>comment.block.powershell</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#commentEmbeddedDocs</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<![\\-])#</string>
|
||||
<key>end</key>
|
||||
<string>$</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.powershell</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#commentEmbeddedDocs</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#variable</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#scriptblock</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<!(?<!`)")"</string>
|
||||
<key>end</key>
|
||||
<string>"(?!")</string>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.powershell</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#variable</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#doubleQuotedStringEscapes</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#interpolation</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>`\s*$</string>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string>Needed to parse stuff correctly in 'argument mode'. (See about_parsing.)</string>
|
||||
<key>include</key>
|
||||
<string>#doubleQuotedStringEscapes</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<!')'</string>
|
||||
<key>end</key>
|
||||
<string>'(?!')</string>
|
||||
<key>name</key>
|
||||
<string>string.quoted.single.powershell</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>''</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.powershell</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>@"$</string>
|
||||
<key>end</key>
|
||||
<string>^"@</string>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.heredoc.powershell</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#interpolation</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>@\(</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\)</string>
|
||||
<key>name</key>
|
||||
<string>meta.group.array-expression.powershell</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>\$\(</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>comment</key>
|
||||
<string>TODO: move to repo; make recursive.</string>
|
||||
<key>end</key>
|
||||
<string>\)</string>
|
||||
<key>name</key>
|
||||
<string>meta.group.complex.subexpression.powershell</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>@'$</string>
|
||||
<key>end</key>
|
||||
<string>^'@$</string>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.heredoc.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#numericConstant</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>-([lg][te]|[ci]?(eq|ne))</string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.logical.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#PSDefaults</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:[a-z][a-z0-9]+-[a-z][a-z0-9]+)</string>
|
||||
<key>name</key>
|
||||
<string>support.function.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(?i:if|else|elseif|switch|while|default|try|finally|catch|for|do|until|break|continue|foreach|return|filter|in|trap|throw|param|begin|process|end|function|global|local|private|script|contained)\b</string>
|
||||
<key>name</key>
|
||||
<string>keyword.control.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>-(?i:(?:[ic]?eq|ne|[gl][te]|(?:not)?(?:like|match|contains)|replace)|is(?:not)?|as|and|or|band|bor|not|f)\b</string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.comparison.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>-(?i:and|or|not)|!</string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.logical.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>-(?i:f|band|bor|-bnot)\b</string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.bitwise.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>-f\b</string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.string-format.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>[+%*/-]?=|[+/*%-]</string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.assignment.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>2>&1|>>|>|<<|<|>|>\||2>|2>>|1>></string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.redirection.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\|{2}|&{2}|;</string>
|
||||
<key>name</key>
|
||||
<string>keyword.other.statement-separator.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>&|(?<!\w)\.(?= )|`|,|\|</string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.other.powershell</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>repository</key>
|
||||
<dict>
|
||||
<key>PSDefaults</key>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string>Default commandlets in Powershell v2</string>
|
||||
<key>match</key>
|
||||
<string>Disconnect-(WSMan)|Exit-(PSSession)|Copy-(Item|ItemProperty)|Resolve-(Path)|Group-(Object)|Remove-(Computer|Event|EventLog|Item|ItemProperty|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|Variable|WmiObject|WSManInstance)|Unregister-(Event|PSSessionConfiguration)|Tee-(Object)|Pop-(Location)|Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item|ItemProperty|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance|WSManInstance|WSManQuickConfig)|Format-(Custom|List|Table|Wide)|Invoke-(Command|Expression|History|Item|WmiMethod|WSManAction)|Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)|Update-(FormatData|List|TypeData)|Sort-(Object)|Measure-(Command|Object)|ForEach-(Object)|Connect-(WSMan)|Suspend-(Service)|ConvertFrom-(Csv|SecureString|StringData)|Where-(Object)|Rename-(Item|ItemProperty)|Convert-(Path)|Select-(Object|String|Xml)|Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)|Stop-(Computer|Job|Process|Service|Transcript)|New-(Alias|Event|EventLog|Item|ItemProperty|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionOption|Service|TimeSpan|Variable|WebServiceProxy|WSManInstance|WSManSessionOption)|Resume-(Service)|Show-(EventLog)|Out-(Default|File|GridView|Host|Null|Printer|String)|Undo-(Transaction)|Trace-(Command)|Clear-(Content|EventLog|History|Item|ItemProperty|Variable)|Push-(Location)|Split-(Path)|Disable-(ComputerRestore|PSBreakpoint|PSSessionConfiguration|WSManCredSSP)|Reset-(ComputerMachinePassword)|Restore-(Computer)|ConvertTo-(Csv|Html|SecureString|Xml)|Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration|WSManCredSSP)|Join-(Path)|Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)|Compare-(Object)|Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|Counter|Credential|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|UICulture|Unique|Variable|WinEvent|WmiObject|WSManCredSSP|WSManInstance)|Receive-(Job)|Move-(Item|ItemProperty)|Add-(Computer|Content|History|Member|PSSnapin|Type)|Wait-(Event|Job|Process)|Send-(MailMessage)|Read-(Host)|Complete-(Transaction)|Checkpoint-(Computer)|Debug-(Process)|Use-(Transaction)|Restart-(Computer|Service)|Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)|Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|WSMan)|Start-(Job|Process|Service|Sleep|Transaction|Transcript)|Limit-(EventLog)|Enter-(PSSession)</string>
|
||||
<key>name</key>
|
||||
<string>support.function.builtin.powershell</string>
|
||||
</dict>
|
||||
<key>commentEmbeddedDocs</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>constant.string.documentation.powershell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.documentation.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\s*(\.)(SYNOPSIS|DESCRIPTION|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|FUNCTIONALITY))</string>
|
||||
<key>name</key>
|
||||
<string>comment.documentation.embedded.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>constant.string.documentation.powershell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.documentation.powershell</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.documentation.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\s*(\.)(PARAMETER|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP)\s+([a-z0-9-_]+))</string>
|
||||
<key>name</key>
|
||||
<string>comment.documentation.embedded.powershell</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>doubleQuotedStringEscapes</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>`[0abnfrvt"'$`]</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>""</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.powershell</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>interpolatedStringContent</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>\(</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>contentName</key>
|
||||
<string>interpolated.simple.source.powershell</string>
|
||||
<key>end</key>
|
||||
<string>\)</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#interpolation</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#interpolatedStringContent</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>interpolation</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(\$)\(</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>contentName</key>
|
||||
<string>interpolated.complex.source.powershell</string>
|
||||
<key>end</key>
|
||||
<string>\)</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#interpolation</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#interpolatedStringContent</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>numericConstant</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>support.constant.powershell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.math.powershell</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>support.constant.powershell</string>
|
||||
</dict>
|
||||
<key>4</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\d+(E)(\+|\-)\d+(d)?(mb|kb|gb)?)</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.scientific.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>support.constant.powershell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?i:(0x)[a-f0-9]+(mb|kb|gb)?)</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.hexadecimal.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>support.constant.powershell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>support.constant.powershell</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>\d*(?<!\.)(\.)\d+(d)?(mb|kb|gb)?</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.double.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>support.constant.powershell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?<!\w)\d+(d)?(mb|kb|gb)?(?!\w)</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.powershell</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>scriptblock</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>\{</string>
|
||||
<key>end</key>
|
||||
<string>\}</string>
|
||||
<key>name</key>
|
||||
<string>meta.scriptblock.powershell</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>variable</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.powershell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>comment</key>
|
||||
<string>Style var name as numeric constant so that they stand out.</string>
|
||||
<key>match</key>
|
||||
<string>(\$)(?i:(\$|\?|\^|args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext|false|FormatEnumerationLimit|HOME|Host|input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|null|OutputEncoding|PID|PROFILE|ProgressPreference|PSBoundParameters|PSCulture|PSEmailServer|PSHOME|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|PWD|ReportErrorShowExceptionClass|ReportErrorShowInnerException|ReportErrorShowSource|ReportErrorShowStackTrace|ShellId|StackTrace|true|VerbosePreference|WarningPreference|WhatIfPreference))\b</string>
|
||||
<key>name</key>
|
||||
<string>support.variable.builtin.powershell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.variable.powershell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>storage.modifier.scope.powershell</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.other.readwrite.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?i:(\$)(?:(private|script|global):)?([a-z0-9_]+))</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.variable.powershell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.other.readwrite.powershell</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>storage.modifier.scope.powershell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?i:(\$)(\{(?:(private|script|global):)?.+?\}))</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>scopeName</key>
|
||||
<string>source.powershell</string>
|
||||
<key>uuid</key>
|
||||
<string>f8f5ffb0-503e-11df-9879-0800200c9a66</string>
|
||||
</dict>
|
||||
</plist>
|
Reference in New Issue
Block a user