tm-grammars 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE +6565 -0
  3. package/README.md +211 -0
  4. package/grammars/abap.json +380 -0
  5. package/grammars/actionscript-3.json +951 -0
  6. package/grammars/ada.json +3874 -0
  7. package/grammars/apache.json +562 -0
  8. package/grammars/apex.json +3203 -0
  9. package/grammars/apl.json +1479 -0
  10. package/grammars/applescript.json +1406 -0
  11. package/grammars/ara.json +428 -0
  12. package/grammars/asm.json +1741 -0
  13. package/grammars/astro.json +776 -0
  14. package/grammars/awk.json +388 -0
  15. package/grammars/ballerina.json +3768 -0
  16. package/grammars/bat.json +783 -0
  17. package/grammars/beancount.json +831 -0
  18. package/grammars/berry.json +172 -0
  19. package/grammars/bibtex.json +315 -0
  20. package/grammars/bicep.json +239 -0
  21. package/grammars/blade.json +3870 -0
  22. package/grammars/c.json +3552 -0
  23. package/grammars/cadence.json +738 -0
  24. package/grammars/clarity.json +877 -0
  25. package/grammars/clojure.json +426 -0
  26. package/grammars/cmake.json +143 -0
  27. package/grammars/cobol.json +1124 -0
  28. package/grammars/codeql.json +1540 -0
  29. package/grammars/coffee.json +1311 -0
  30. package/grammars/cpp-macro.json +9498 -0
  31. package/grammars/cpp.json +16635 -0
  32. package/grammars/crystal.json +1866 -0
  33. package/grammars/csharp.json +5722 -0
  34. package/grammars/css.json +1860 -0
  35. package/grammars/csv.json +46 -0
  36. package/grammars/cue.json +1128 -0
  37. package/grammars/cypher.json +353 -0
  38. package/grammars/d.json +3185 -0
  39. package/grammars/dart.json +522 -0
  40. package/grammars/dax.json +185 -0
  41. package/grammars/diff.json +155 -0
  42. package/grammars/docker.json +97 -0
  43. package/grammars/dream-maker.json +640 -0
  44. package/grammars/elixir.json +1014 -0
  45. package/grammars/elm.json +751 -0
  46. package/grammars/erb.json +156 -0
  47. package/grammars/erlang.json +1757 -0
  48. package/grammars/fish.json +189 -0
  49. package/grammars/fsharp.json +1831 -0
  50. package/grammars/gdresource.json +290 -0
  51. package/grammars/gdscript.json +969 -0
  52. package/grammars/gdshader.json +405 -0
  53. package/grammars/gherkin.json +133 -0
  54. package/grammars/git-commit.json +85 -0
  55. package/grammars/git-rebase.json +56 -0
  56. package/grammars/glimmer-js.json +98 -0
  57. package/grammars/glimmer-ts.json +98 -0
  58. package/grammars/glsl.json +57 -0
  59. package/grammars/gnuplot.json +892 -0
  60. package/grammars/go.json +1012 -0
  61. package/grammars/graphql.json +1295 -0
  62. package/grammars/groovy.json +1378 -0
  63. package/grammars/hack.json +2650 -0
  64. package/grammars/haml.json +598 -0
  65. package/grammars/handlebars.json +848 -0
  66. package/grammars/haskell.json +2431 -0
  67. package/grammars/hcl.json +787 -0
  68. package/grammars/hjson.json +821 -0
  69. package/grammars/hlsl.json +212 -0
  70. package/grammars/html.json +93 -0
  71. package/grammars/imba.json +2696 -0
  72. package/grammars/ini.json +108 -0
  73. package/grammars/java.json +1885 -0
  74. package/grammars/javascript.json +5984 -0
  75. package/grammars/jinja-html.json +16 -0
  76. package/grammars/jinja.json +345 -0
  77. package/grammars/jison.json +715 -0
  78. package/grammars/jsdoc.json +21 -0
  79. package/grammars/json.json +208 -0
  80. package/grammars/json5.json +244 -0
  81. package/grammars/jsonc.json +208 -0
  82. package/grammars/jsonl.json +208 -0
  83. package/grammars/jsonnet.json +211 -0
  84. package/grammars/jssm.json +159 -0
  85. package/grammars/jsx.json +5984 -0
  86. package/grammars/julia.json +1061 -0
  87. package/grammars/kotlin.json +580 -0
  88. package/grammars/kusto.json +687 -0
  89. package/grammars/latex.json +2395 -0
  90. package/grammars/less.json +5012 -0
  91. package/grammars/liquid.json +990 -0
  92. package/grammars/lisp.json +121 -0
  93. package/grammars/logo.json +55 -0
  94. package/grammars/lua.json +956 -0
  95. package/grammars/make.json +629 -0
  96. package/grammars/markdown.json +3066 -0
  97. package/grammars/marko.json +1344 -0
  98. package/grammars/matlab.json +1131 -0
  99. package/grammars/mdc.json +571 -0
  100. package/grammars/mdx.json +5629 -0
  101. package/grammars/mermaid.json +1382 -0
  102. package/grammars/mojo.json +4153 -0
  103. package/grammars/narrat.json +227 -0
  104. package/grammars/nextflow.json +298 -0
  105. package/grammars/nginx.json +2121 -0
  106. package/grammars/nim.json +1522 -0
  107. package/grammars/nix.json +1200 -0
  108. package/grammars/nushell.json +1047 -0
  109. package/grammars/objective-c.json +3750 -0
  110. package/grammars/objective-cpp.json +7242 -0
  111. package/grammars/ocaml.json +2967 -0
  112. package/grammars/pascal.json +154 -0
  113. package/grammars/perl.json +2971 -0
  114. package/grammars/php.json +4024 -0
  115. package/grammars/plsql.json +241 -0
  116. package/grammars/postcss.json +377 -0
  117. package/grammars/powerquery.json +349 -0
  118. package/grammars/powershell.json +1024 -0
  119. package/grammars/prisma.json +443 -0
  120. package/grammars/prolog.json +298 -0
  121. package/grammars/proto.json +507 -0
  122. package/grammars/pug.json +1033 -0
  123. package/grammars/puppet.json +777 -0
  124. package/grammars/purescript.json +871 -0
  125. package/grammars/python.json +4208 -0
  126. package/grammars/r.json +637 -0
  127. package/grammars/raku.json +310 -0
  128. package/grammars/razor.json +1813 -0
  129. package/grammars/reg.json +136 -0
  130. package/grammars/rel.json +200 -0
  131. package/grammars/riscv.json +298 -0
  132. package/grammars/rst.json +734 -0
  133. package/grammars/ruby.json +2769 -0
  134. package/grammars/rust.json +1171 -0
  135. package/grammars/sas.json +302 -0
  136. package/grammars/sass.json +618 -0
  137. package/grammars/scala.json +1313 -0
  138. package/grammars/scheme.json +384 -0
  139. package/grammars/scss.json +1874 -0
  140. package/grammars/shaderlab.json +199 -0
  141. package/grammars/shellscript.json +2025 -0
  142. package/grammars/shellsession.json +33 -0
  143. package/grammars/smalltalk.json +235 -0
  144. package/grammars/solidity.json +1210 -0
  145. package/grammars/sparql.json +45 -0
  146. package/grammars/splunk.json +91 -0
  147. package/grammars/sql.json +631 -0
  148. package/grammars/ssh-config.json +88 -0
  149. package/grammars/stata.json +3050 -0
  150. package/grammars/stylus.json +1208 -0
  151. package/grammars/svelte.json +1171 -0
  152. package/grammars/swift.json +4203 -0
  153. package/grammars/system-verilog.json +1063 -0
  154. package/grammars/tasl.json +292 -0
  155. package/grammars/tcl.json +291 -0
  156. package/grammars/tex.json +281 -0
  157. package/grammars/toml.json +431 -0
  158. package/grammars/tsx.json +5984 -0
  159. package/grammars/turtle.json +261 -0
  160. package/grammars/twig.json +1394 -0
  161. package/grammars/typescript.json +5735 -0
  162. package/grammars/v.json +1001 -0
  163. package/grammars/vb.json +232 -0
  164. package/grammars/verilog.json +305 -0
  165. package/grammars/vhdl.json +1484 -0
  166. package/grammars/viml.json +445 -0
  167. package/grammars/vue-html.json +559 -0
  168. package/grammars/vue.json +1237 -0
  169. package/grammars/vyper.json +5415 -0
  170. package/grammars/wasm.json +831 -0
  171. package/grammars/wenyan.json +129 -0
  172. package/grammars/wgsl.json +391 -0
  173. package/grammars/wolfram.json +2370 -0
  174. package/grammars/xml.json +382 -0
  175. package/grammars/xsl.json +89 -0
  176. package/grammars/yaml.json +616 -0
  177. package/grammars/zenscript.json +257 -0
  178. package/grammars/zig.json +312 -0
  179. package/index.d.ts +18 -0
  180. package/index.js +2165 -0
  181. package/package.json +46 -0
@@ -0,0 +1,1024 @@
1
+ {
2
+ "displayName": "PowerShell",
3
+ "name": "powershell",
4
+ "patterns": [
5
+ {
6
+ "begin": "<#",
7
+ "beginCaptures": {
8
+ "0": {
9
+ "name": "punctuation.definition.comment.block.begin.powershell"
10
+ }
11
+ },
12
+ "end": "#>",
13
+ "endCaptures": {
14
+ "0": {
15
+ "name": "punctuation.definition.comment.block.end.powershell"
16
+ }
17
+ },
18
+ "name": "comment.block.powershell",
19
+ "patterns": [
20
+ {
21
+ "include": "#commentEmbeddedDocs"
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "match": "[2-6]>&1|>>|>|<<|<|>|>\\||[1-6]>|[1-6]>>",
27
+ "name": "keyword.operator.redirection.powershell"
28
+ },
29
+ {
30
+ "include": "#commands"
31
+ },
32
+ {
33
+ "include": "#commentLine"
34
+ },
35
+ {
36
+ "include": "#variable"
37
+ },
38
+ {
39
+ "include": "#subexpression"
40
+ },
41
+ {
42
+ "include": "#function"
43
+ },
44
+ {
45
+ "include": "#attribute"
46
+ },
47
+ {
48
+ "include": "#UsingDirective"
49
+ },
50
+ {
51
+ "include": "#type"
52
+ },
53
+ {
54
+ "include": "#hashtable"
55
+ },
56
+ {
57
+ "include": "#doubleQuotedString"
58
+ },
59
+ {
60
+ "include": "#scriptblock"
61
+ },
62
+ {
63
+ "comment": "Needed to parse stuff correctly in 'argument mode'. (See about_parsing.)",
64
+ "include": "#doubleQuotedStringEscapes"
65
+ },
66
+ {
67
+ "applyEndPatternLast": true,
68
+ "begin": "['\\x{2018}-\\x{201B}]",
69
+ "beginCaptures": {
70
+ "0": {
71
+ "name": "punctuation.definition.string.begin.powershell"
72
+ }
73
+ },
74
+ "end": "['\\x{2018}-\\x{201B}]",
75
+ "endCaptures": {
76
+ "0": {
77
+ "name": "punctuation.definition.string.end.powershell"
78
+ }
79
+ },
80
+ "name": "string.quoted.single.powershell",
81
+ "patterns": [
82
+ {
83
+ "match": "['\\x{2018}-\\x{201B}]{2}",
84
+ "name": "constant.character.escape.powershell"
85
+ }
86
+ ]
87
+ },
88
+ {
89
+ "begin": "(@[\"\\x{201C}-\\x{201E}])\\s*$",
90
+ "beginCaptures": {
91
+ "1": {
92
+ "name": "punctuation.definition.string.begin.powershell"
93
+ }
94
+ },
95
+ "end": "^[\"\\x{201C}-\\x{201E}]@",
96
+ "endCaptures": {
97
+ "0": {
98
+ "name": "punctuation.definition.string.end.powershell"
99
+ }
100
+ },
101
+ "name": "string.quoted.double.heredoc.powershell",
102
+ "patterns": [
103
+ {
104
+ "include": "#variableNoProperty"
105
+ },
106
+ {
107
+ "include": "#doubleQuotedStringEscapes"
108
+ },
109
+ {
110
+ "include": "#interpolation"
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "begin": "(@['\\x{2018}-\\x{201B}])\\s*$",
116
+ "beginCaptures": {
117
+ "1": {
118
+ "name": "punctuation.definition.string.begin.powershell"
119
+ }
120
+ },
121
+ "end": "^['\\x{2018}-\\x{201B}]@",
122
+ "endCaptures": {
123
+ "0": {
124
+ "name": "punctuation.definition.string.end.powershell"
125
+ }
126
+ },
127
+ "name": "string.quoted.single.heredoc.powershell"
128
+ },
129
+ {
130
+ "include": "#numericConstant"
131
+ },
132
+ {
133
+ "begin": "(@)(\\()",
134
+ "beginCaptures": {
135
+ "1": {
136
+ "name": "keyword.other.array.begin.powershell"
137
+ },
138
+ "2": {
139
+ "name": "punctuation.section.group.begin.powershell"
140
+ }
141
+ },
142
+ "end": "\\)",
143
+ "endCaptures": {
144
+ "0": {
145
+ "name": "punctuation.section.group.end.powershell"
146
+ }
147
+ },
148
+ "name": "meta.group.array-expression.powershell",
149
+ "patterns": [
150
+ {
151
+ "include": "$self"
152
+ }
153
+ ]
154
+ },
155
+ {
156
+ "begin": "((\\$))(\\()",
157
+ "beginCaptures": {
158
+ "1": {
159
+ "name": "keyword.other.substatement.powershell"
160
+ },
161
+ "2": {
162
+ "name": "punctuation.definition.subexpression.powershell"
163
+ },
164
+ "3": {
165
+ "name": "punctuation.section.group.begin.powershell"
166
+ }
167
+ },
168
+ "comment": "TODO: move to repo; make recursive.",
169
+ "end": "\\)",
170
+ "endCaptures": {
171
+ "0": {
172
+ "name": "punctuation.section.group.end.powershell"
173
+ }
174
+ },
175
+ "name": "meta.group.complex.subexpression.powershell",
176
+ "patterns": [
177
+ {
178
+ "include": "$self"
179
+ }
180
+ ]
181
+ },
182
+ {
183
+ "match": "(\\b(([A-Za-z0-9\\-_\\.]+)\\.(?i:exe|com|cmd|bat))\\b)",
184
+ "name": "support.function.powershell"
185
+ },
186
+ {
187
+ "match": "(?<!\\w|-|\\.)((?i:begin|break|catch|clean|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|from|if|in|inlinescript|parallel|param|process|return|sequence|switch|throw|trap|try|until|var|while)|%|\\?)(?!\\w)",
188
+ "name": "keyword.control.powershell"
189
+ },
190
+ {
191
+ "match": "(?<!\\w|-|[^\\)]\\.)((?i:(foreach|where)(?!-object))|%|\\?)(?!\\w)",
192
+ "name": "keyword.control.powershell"
193
+ },
194
+ {
195
+ "begin": "(?<!\\w)(--%)(?!\\w)",
196
+ "beginCaptures": {
197
+ "1": {
198
+ "name": "keyword.control.powershell"
199
+ }
200
+ },
201
+ "comment": "This should be moved to the repository at some point.",
202
+ "end": "$",
203
+ "patterns": [
204
+ {
205
+ "match": ".+",
206
+ "name": "string.unquoted.powershell"
207
+ }
208
+ ]
209
+ },
210
+ {
211
+ "comment": "This should only be relevant inside a class but will require a rework of how classes are matched. This is a temp fix.",
212
+ "match": "(?<!\\w)((?i:hidden|static))(?!\\w)",
213
+ "name": "storage.modifier.powershell"
214
+ },
215
+ {
216
+ "captures": {
217
+ "1": {
218
+ "name": "storage.type.powershell"
219
+ },
220
+ "2": {
221
+ "name": "entity.name.function"
222
+ }
223
+ },
224
+ "comment": "capture should be entity.name.type, but it doesn't provide a good color in the default schema.",
225
+ "match": "(?<!\\w|-)((?i:class)|%|\\?)(?:\\s)+((?:\\p{L}|\\d|_|-|)+)\\b"
226
+ },
227
+ {
228
+ "match": "(?<!\\w)-(?i:is(?:not)?|as)\\b",
229
+ "name": "keyword.operator.comparison.powershell"
230
+ },
231
+ {
232
+ "match": "(?<!\\w)-(?i:[ic]?(?:eq|ne|[gl][te]|(?:not)?(?:like|match|contains|in)|replace))(?!\\p{L})",
233
+ "name": "keyword.operator.comparison.powershell"
234
+ },
235
+ {
236
+ "match": "(?<!\\w)-(?i:join|split)(?!\\p{L})|!",
237
+ "name": "keyword.operator.unary.powershell"
238
+ },
239
+ {
240
+ "match": "(?<!\\w)-(?i:and|or|not|xor)(?!\\p{L})|!",
241
+ "name": "keyword.operator.logical.powershell"
242
+ },
243
+ {
244
+ "match": "(?<!\\w)-(?i:band|bor|bnot|bxor|shl|shr)(?!\\p{L})",
245
+ "name": "keyword.operator.bitwise.powershell"
246
+ },
247
+ {
248
+ "match": "(?<!\\w)-(?i:f)(?!\\p{L})",
249
+ "name": "keyword.operator.string-format.powershell"
250
+ },
251
+ {
252
+ "match": "[+%*/-]?=|[+/*%-]",
253
+ "name": "keyword.operator.assignment.powershell"
254
+ },
255
+ {
256
+ "match": "\\|{2}|&{2}|;",
257
+ "name": "punctuation.terminator.statement.powershell"
258
+ },
259
+ {
260
+ "match": "&|(?<!\\w)\\.(?= )|`|,|\\|",
261
+ "name": "keyword.operator.other.powershell"
262
+ },
263
+ {
264
+ "comment": "This is very imprecise, is there a syntax for 'must come after...' ",
265
+ "match": "(?<!\\s|^)\\.\\.(?=\\-?\\d|\\(|\\$)",
266
+ "name": "keyword.operator.range.powershell"
267
+ }
268
+ ],
269
+ "repository": {
270
+ "RequiresDirective": {
271
+ "begin": "(?<=#)(?i:(requires))\\s",
272
+ "beginCaptures": {
273
+ "0": {
274
+ "name": "keyword.control.requires.powershell"
275
+ }
276
+ },
277
+ "end": "$",
278
+ "name": "meta.requires.powershell",
279
+ "patterns": [
280
+ {
281
+ "match": "\\-(?i:Modules|PSSnapin|RunAsAdministrator|ShellId|Version|Assembly|PSEdition)",
282
+ "name": "keyword.other.powershell"
283
+ },
284
+ {
285
+ "match": "(?<!-)\\b\\p{L}+|\\d+(?:\\.\\d+)*",
286
+ "name": "variable.parameter.powershell"
287
+ },
288
+ {
289
+ "include": "#hashtable"
290
+ }
291
+ ]
292
+ },
293
+ "UsingDirective": {
294
+ "captures": {
295
+ "1": {
296
+ "name": "keyword.control.using.powershell"
297
+ },
298
+ "2": {
299
+ "name": "keyword.other.powershell"
300
+ },
301
+ "3": {
302
+ "name": "variable.parameter.powershell"
303
+ }
304
+ },
305
+ "match": "(?<!\\w)(?i:(using))\\s+(?i:(namespace|module))\\s+(?i:((?:\\w+(?:\\.)?)+))"
306
+ },
307
+ "attribute": {
308
+ "begin": "(\\[)\\s*\\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength|supportswildcards)\\b",
309
+ "beginCaptures": {
310
+ "1": {
311
+ "name": "punctuation.section.bracket.begin.powershell"
312
+ },
313
+ "2": {
314
+ "name": "support.function.attribute.powershell"
315
+ }
316
+ },
317
+ "end": "(\\])",
318
+ "endCaptures": {
319
+ "1": {
320
+ "name": "punctuation.section.bracket.end.powershell"
321
+ }
322
+ },
323
+ "name": "meta.attribute.powershell",
324
+ "patterns": [
325
+ {
326
+ "begin": "\\(",
327
+ "beginCaptures": {
328
+ "0": {
329
+ "name": "punctuation.section.group.begin.powershell"
330
+ }
331
+ },
332
+ "end": "\\)",
333
+ "endCaptures": {
334
+ "0": {
335
+ "name": "punctuation.section.group.end.powershell"
336
+ }
337
+ },
338
+ "patterns": [
339
+ {
340
+ "include": "$self"
341
+ },
342
+ {
343
+ "captures": {
344
+ "1": {
345
+ "name": "variable.parameter.attribute.powershell"
346
+ },
347
+ "2": {
348
+ "name": "keyword.operator.assignment.powershell"
349
+ }
350
+ },
351
+ "match": "(?i)\\b(mandatory|valuefrompipeline|valuefrompipelinebypropertyname|valuefromremainingarguments|position|parametersetname|defaultparametersetname|supportsshouldprocess|supportspaging|positionalbinding|helpuri|confirmimpact|helpmessage)\\b(?:\\s+)?(=)?"
352
+ }
353
+ ]
354
+ }
355
+ ]
356
+ },
357
+ "commands": {
358
+ "patterns": [
359
+ {
360
+ "comment": "Verb-Noun pattern:",
361
+ "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",
362
+ "name": "support.function.powershell"
363
+ },
364
+ {
365
+ "comment": "Builtin cmdlets with reserved verbs",
366
+ "match": "(?<!\\w)(?i:foreach-object)(?!\\w)",
367
+ "name": "support.function.powershell"
368
+ },
369
+ {
370
+ "comment": "Builtin cmdlets with reserved verbs",
371
+ "match": "(?<!\\w)(?i:where-object)(?!\\w)",
372
+ "name": "support.function.powershell"
373
+ },
374
+ {
375
+ "comment": "Builtin cmdlets with reserved verbs",
376
+ "match": "(?<!\\w)(?i:sort-object)(?!\\w)",
377
+ "name": "support.function.powershell"
378
+ },
379
+ {
380
+ "comment": "Builtin cmdlets with reserved verbs",
381
+ "match": "(?<!\\w)(?i:tee-object)(?!\\w)",
382
+ "name": "support.function.powershell"
383
+ }
384
+ ]
385
+ },
386
+ "commentEmbeddedDocs": {
387
+ "patterns": [
388
+ {
389
+ "captures": {
390
+ "1": {
391
+ "name": "constant.string.documentation.powershell"
392
+ },
393
+ "2": {
394
+ "name": "keyword.operator.documentation.powershell"
395
+ }
396
+ },
397
+ "comment": "these embedded doc keywords do not support arguments, must be the only thing on the line",
398
+ "match": "(?:^|\\G)(?i:\\s*(\\.)(COMPONENT|DESCRIPTION|EXAMPLE|FUNCTIONALITY|INPUTS|LINK|NOTES|OUTPUTS|ROLE|SYNOPSIS))\\s*$",
399
+ "name": "comment.documentation.embedded.powershell"
400
+ },
401
+ {
402
+ "captures": {
403
+ "1": {
404
+ "name": "constant.string.documentation.powershell"
405
+ },
406
+ "2": {
407
+ "name": "keyword.operator.documentation.powershell"
408
+ },
409
+ "3": {
410
+ "name": "keyword.operator.documentation.powershell"
411
+ }
412
+ },
413
+ "comment": "these embedded doc keywords require arguments though the type required may be inconsistent, they may not all be able to use the same argument match",
414
+ "match": "(?:^|\\G)(?i:\\s*(\\.)(EXTERNALHELP|FORWARDHELP(?:CATEGORY|TARGETNAME)|PARAMETER|REMOTEHELPRUNSPACE))\\s+(.+?)\\s*$",
415
+ "name": "comment.documentation.embedded.powershell"
416
+ }
417
+ ]
418
+ },
419
+ "commentLine": {
420
+ "begin": "(?<![`\\\\-])(#)#*",
421
+ "captures": {
422
+ "1": {
423
+ "name": "punctuation.definition.comment.powershell"
424
+ }
425
+ },
426
+ "end": "$\\n?",
427
+ "name": "comment.line.powershell",
428
+ "patterns": [
429
+ {
430
+ "include": "#commentEmbeddedDocs"
431
+ },
432
+ {
433
+ "include": "#RequiresDirective"
434
+ }
435
+ ]
436
+ },
437
+ "doubleQuotedString": {
438
+ "applyEndPatternLast": true,
439
+ "begin": "[\"\\x{201C}-\\x{201E}]",
440
+ "beginCaptures": {
441
+ "0": {
442
+ "name": "punctuation.definition.string.begin.powershell"
443
+ }
444
+ },
445
+ "end": "[\"\\x{201C}-\\x{201E}]",
446
+ "endCaptures": {
447
+ "0": {
448
+ "name": "punctuation.definition.string.end.powershell"
449
+ }
450
+ },
451
+ "name": "string.quoted.double.powershell",
452
+ "patterns": [
453
+ {
454
+ "match": "(?i)\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,64}\\b"
455
+ },
456
+ {
457
+ "include": "#variableNoProperty"
458
+ },
459
+ {
460
+ "include": "#doubleQuotedStringEscapes"
461
+ },
462
+ {
463
+ "match": "[\"\\x{201C}-\\x{201E}]{2}",
464
+ "name": "constant.character.escape.powershell"
465
+ },
466
+ {
467
+ "include": "#interpolation"
468
+ },
469
+ {
470
+ "match": "`\\s*$",
471
+ "name": "keyword.other.powershell"
472
+ }
473
+ ]
474
+ },
475
+ "doubleQuotedStringEscapes": {
476
+ "patterns": [
477
+ {
478
+ "match": "`[`0abefnrtv'\"\\x{2018}-\\x{201E}$]",
479
+ "name": "constant.character.escape.powershell"
480
+ },
481
+ {
482
+ "include": "#unicodeEscape"
483
+ }
484
+ ]
485
+ },
486
+ "function": {
487
+ "begin": "^(?:\\s*+)(?i)(function|filter|configuration|workflow)\\s+(?:(global|local|script|private):)?((?:\\p{L}|\\d|_|-|\\.)+)",
488
+ "beginCaptures": {
489
+ "0": {
490
+ "name": "meta.function.powershell"
491
+ },
492
+ "1": {
493
+ "name": "storage.type.powershell"
494
+ },
495
+ "2": {
496
+ "name": "storage.modifier.scope.powershell"
497
+ },
498
+ "3": {
499
+ "name": "entity.name.function.powershell"
500
+ }
501
+ },
502
+ "end": "(?=\\{|\\()",
503
+ "patterns": [
504
+ {
505
+ "include": "#commentLine"
506
+ }
507
+ ]
508
+ },
509
+ "hashtable": {
510
+ "begin": "(@)(\\{)",
511
+ "beginCaptures": {
512
+ "1": {
513
+ "name": "keyword.other.hashtable.begin.powershell"
514
+ },
515
+ "2": {
516
+ "name": "punctuation.section.braces.begin.powershell"
517
+ }
518
+ },
519
+ "end": "(\\})",
520
+ "endCaptures": {
521
+ "1": {
522
+ "name": "punctuation.section.braces.end.powershell"
523
+ }
524
+ },
525
+ "name": "meta.hashtable.powershell",
526
+ "patterns": [
527
+ {
528
+ "captures": {
529
+ "1": {
530
+ "name": "punctuation.definition.string.begin.powershell"
531
+ },
532
+ "2": {
533
+ "name": "variable.other.readwrite.powershell"
534
+ },
535
+ "3": {
536
+ "name": "punctuation.definition.string.end.powershell"
537
+ },
538
+ "4": {
539
+ "name": "keyword.operator.assignment.powershell"
540
+ }
541
+ },
542
+ "match": "\\b((?:\\'|\\\")?)(\\w+)((?:\\'|\\\")?)(?:\\s+)?(=)(?:\\s+)?",
543
+ "name": "meta.hashtable.assignment.powershell"
544
+ },
545
+ {
546
+ "include": "#scriptblock"
547
+ },
548
+ {
549
+ "include": "$self"
550
+ }
551
+ ]
552
+ },
553
+ "interpolation": {
554
+ "begin": "(((\\$)))((\\())",
555
+ "beginCaptures": {
556
+ "1": {
557
+ "name": "keyword.other.substatement.powershell"
558
+ },
559
+ "2": {
560
+ "name": "punctuation.definition.substatement.powershell"
561
+ },
562
+ "3": {
563
+ "name": "punctuation.section.embedded.substatement.begin.powershell"
564
+ },
565
+ "4": {
566
+ "name": "punctuation.section.group.begin.powershell"
567
+ },
568
+ "5": {
569
+ "name": "punctuation.section.embedded.substatement.begin.powershell"
570
+ }
571
+ },
572
+ "contentName": "interpolated.complex.source.powershell",
573
+ "end": "(\\))",
574
+ "endCaptures": {
575
+ "0": {
576
+ "name": "punctuation.section.group.end.powershell"
577
+ },
578
+ "1": {
579
+ "name": "punctuation.section.embedded.substatement.end.powershell"
580
+ }
581
+ },
582
+ "name": "meta.embedded.substatement.powershell",
583
+ "patterns": [
584
+ {
585
+ "include": "$self"
586
+ }
587
+ ]
588
+ },
589
+ "numericConstant": {
590
+ "patterns": [
591
+ {
592
+ "captures": {
593
+ "1": {
594
+ "name": "constant.numeric.hex.powershell"
595
+ },
596
+ "2": {
597
+ "name": "keyword.other.powershell"
598
+ }
599
+ },
600
+ "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"
601
+ },
602
+ {
603
+ "captures": {
604
+ "1": {
605
+ "name": "constant.numeric.integer.powershell"
606
+ },
607
+ "2": {
608
+ "name": "keyword.other.powershell"
609
+ }
610
+ },
611
+ "match": "(?<!\\w)([-+]?(?:[0-9_]+)?\\.[0-9_]+(?:(?:e|E)[0-9]+)?(?:F|f|D|d|M|m)?)((?i:[kmgtp]b)?)\\b"
612
+ },
613
+ {
614
+ "captures": {
615
+ "1": {
616
+ "name": "constant.numeric.octal.powershell"
617
+ },
618
+ "2": {
619
+ "name": "keyword.other.powershell"
620
+ }
621
+ },
622
+ "match": "(?<!\\w)([-+]?0(?:b|B)[01_]+(?:U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[kmgtp]b)?)\\b"
623
+ },
624
+ {
625
+ "captures": {
626
+ "1": {
627
+ "name": "constant.numeric.integer.powershell"
628
+ },
629
+ "2": {
630
+ "name": "keyword.other.powershell"
631
+ }
632
+ },
633
+ "match": "(?<!\\w)([-+]?[0-9_]+(?:e|E)(?:[0-9_])?+(?:F|f|D|d|M|m)?)((?i:[kmgtp]b)?)\\b"
634
+ },
635
+ {
636
+ "captures": {
637
+ "1": {
638
+ "name": "constant.numeric.integer.powershell"
639
+ },
640
+ "2": {
641
+ "name": "keyword.other.powershell"
642
+ }
643
+ },
644
+ "match": "(?<!\\w)([-+]?[0-9_]+\\.(?:e|E)(?:[0-9_])?+(?:F|f|D|d|M|m)?)((?i:[kmgtp]b)?)\\b"
645
+ },
646
+ {
647
+ "captures": {
648
+ "1": {
649
+ "name": "constant.numeric.integer.powershell"
650
+ },
651
+ "2": {
652
+ "name": "keyword.other.powershell"
653
+ }
654
+ },
655
+ "match": "(?<!\\w)([-+]?[0-9_]+[\\.]?(?:F|f|D|d|M|m))((?i:[kmgtp]b)?)\\b"
656
+ },
657
+ {
658
+ "captures": {
659
+ "1": {
660
+ "name": "constant.numeric.integer.powershell"
661
+ },
662
+ "2": {
663
+ "name": "keyword.other.powershell"
664
+ }
665
+ },
666
+ "match": "(?<!\\w)([-+]?[0-9_]+[\\.]?(?:U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[kmgtp]b)?)\\b"
667
+ }
668
+ ]
669
+ },
670
+ "scriptblock": {
671
+ "begin": "\\{",
672
+ "beginCaptures": {
673
+ "0": {
674
+ "name": "punctuation.section.braces.begin.powershell"
675
+ }
676
+ },
677
+ "end": "\\}",
678
+ "endCaptures": {
679
+ "0": {
680
+ "name": "punctuation.section.braces.end.powershell"
681
+ }
682
+ },
683
+ "name": "meta.scriptblock.powershell",
684
+ "patterns": [
685
+ {
686
+ "include": "$self"
687
+ }
688
+ ]
689
+ },
690
+ "subexpression": {
691
+ "begin": "\\(",
692
+ "beginCaptures": {
693
+ "0": {
694
+ "name": "punctuation.section.group.begin.powershell"
695
+ }
696
+ },
697
+ "end": "\\)",
698
+ "endCaptures": {
699
+ "0": {
700
+ "name": "punctuation.section.group.end.powershell"
701
+ }
702
+ },
703
+ "name": "meta.group.simple.subexpression.powershell",
704
+ "patterns": [
705
+ {
706
+ "include": "$self"
707
+ }
708
+ ]
709
+ },
710
+ "type": {
711
+ "begin": "\\[",
712
+ "beginCaptures": {
713
+ "0": {
714
+ "name": "punctuation.section.bracket.begin.powershell"
715
+ }
716
+ },
717
+ "end": "\\]",
718
+ "endCaptures": {
719
+ "0": {
720
+ "name": "punctuation.section.bracket.end.powershell"
721
+ }
722
+ },
723
+ "patterns": [
724
+ {
725
+ "match": "(?!\\d+|\\.)(?:\\p{L}|\\p{N}|\\.)+",
726
+ "name": "storage.type.powershell"
727
+ },
728
+ {
729
+ "include": "$self"
730
+ }
731
+ ]
732
+ },
733
+ "unicodeEscape": {
734
+ "comment": "`u{xxxx} added in PowerShell 6.0",
735
+ "patterns": [
736
+ {
737
+ "match": "`u\\{(?:(?:10)?([0-9a-fA-F]){1,4}|0?\\g<1>{1,5})}",
738
+ "name": "constant.character.escape.powershell"
739
+ },
740
+ {
741
+ "match": "`u(?:\\{[0-9a-fA-F]{,6}.)?",
742
+ "name": "invalid.character.escape.powershell"
743
+ }
744
+ ]
745
+ },
746
+ "variable": {
747
+ "patterns": [
748
+ {
749
+ "captures": {
750
+ "0": {
751
+ "name": "constant.language.powershell"
752
+ },
753
+ "1": {
754
+ "name": "punctuation.definition.variable.powershell"
755
+ }
756
+ },
757
+ "comment": "These are special constants.",
758
+ "match": "(\\$)(?i:(False|Null|True))\\b"
759
+ },
760
+ {
761
+ "captures": {
762
+ "0": {
763
+ "name": "support.constant.variable.powershell"
764
+ },
765
+ "1": {
766
+ "name": "punctuation.definition.variable.powershell"
767
+ },
768
+ "3": {
769
+ "name": "variable.other.member.powershell"
770
+ }
771
+ },
772
+ "comment": "These are the other built-in constants.",
773
+ "match": "(\\$)(?i:(Error|ExecutionContext|Host|Home|PID|PsHome|PsVersionTable|ShellID))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?\\b"
774
+ },
775
+ {
776
+ "captures": {
777
+ "0": {
778
+ "name": "support.variable.automatic.powershell"
779
+ },
780
+ "1": {
781
+ "name": "punctuation.definition.variable.powershell"
782
+ },
783
+ "3": {
784
+ "name": "variable.other.member.powershell"
785
+ }
786
+ },
787
+ "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.",
788
+ "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)?"
789
+ },
790
+ {
791
+ "captures": {
792
+ "0": {
793
+ "name": "variable.language.powershell"
794
+ },
795
+ "1": {
796
+ "name": "punctuation.definition.variable.powershell"
797
+ },
798
+ "3": {
799
+ "name": "variable.other.member.powershell"
800
+ }
801
+ },
802
+ "comment": "Style preference variables as language variables so that they stand out.",
803
+ "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"
804
+ },
805
+ {
806
+ "captures": {
807
+ "0": {
808
+ "name": "variable.other.readwrite.powershell"
809
+ },
810
+ "1": {
811
+ "name": "punctuation.definition.variable.powershell"
812
+ },
813
+ "2": {
814
+ "name": "storage.modifier.scope.powershell"
815
+ },
816
+ "4": {
817
+ "name": "variable.other.member.powershell"
818
+ }
819
+ },
820
+ "match": "(?i:(\\$|@)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
821
+ },
822
+ {
823
+ "captures": {
824
+ "0": {
825
+ "name": "variable.other.readwrite.powershell"
826
+ },
827
+ "1": {
828
+ "name": "punctuation.definition.variable.powershell"
829
+ },
830
+ "2": {
831
+ "name": "punctuation.section.braces.begin.powershell"
832
+ },
833
+ "3": {
834
+ "name": "storage.modifier.scope.powershell"
835
+ },
836
+ "5": {
837
+ "name": "punctuation.section.braces.end.powershell"
838
+ },
839
+ "6": {
840
+ "name": "variable.other.member.powershell"
841
+ }
842
+ },
843
+ "match": "(?i:(\\$)(\\{)(global|local|private|script|using|workflow):([^}]*[^}`])(\\}))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
844
+ },
845
+ {
846
+ "captures": {
847
+ "0": {
848
+ "name": "variable.other.readwrite.powershell"
849
+ },
850
+ "1": {
851
+ "name": "punctuation.definition.variable.powershell"
852
+ },
853
+ "2": {
854
+ "name": "support.variable.drive.powershell"
855
+ },
856
+ "4": {
857
+ "name": "variable.other.member.powershell"
858
+ }
859
+ },
860
+ "match": "(?i:(\\$|@)((?:\\p{L}|\\d|_)+:)?((?:\\p{L}|\\d|_)+))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
861
+ },
862
+ {
863
+ "captures": {
864
+ "0": {
865
+ "name": "variable.other.readwrite.powershell"
866
+ },
867
+ "1": {
868
+ "name": "punctuation.definition.variable.powershell"
869
+ },
870
+ "2": {
871
+ "name": "punctuation.section.braces.begin.powershell"
872
+ },
873
+ "3": {
874
+ "name": "support.variable.drive.powershell"
875
+ },
876
+ "5": {
877
+ "name": "punctuation.section.braces.end.powershell"
878
+ },
879
+ "6": {
880
+ "name": "variable.other.member.powershell"
881
+ }
882
+ },
883
+ "match": "(?i:(\\$)(\\{)((?:\\p{L}|\\d|_)+:)?([^}]*[^}`])(\\}))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
884
+ }
885
+ ]
886
+ },
887
+ "variableNoProperty": {
888
+ "patterns": [
889
+ {
890
+ "captures": {
891
+ "0": {
892
+ "name": "constant.language.powershell"
893
+ },
894
+ "1": {
895
+ "name": "punctuation.definition.variable.powershell"
896
+ }
897
+ },
898
+ "comment": "These are special constants.",
899
+ "match": "(\\$)(?i:(False|Null|True))\\b"
900
+ },
901
+ {
902
+ "captures": {
903
+ "0": {
904
+ "name": "support.constant.variable.powershell"
905
+ },
906
+ "1": {
907
+ "name": "punctuation.definition.variable.powershell"
908
+ },
909
+ "3": {
910
+ "name": "variable.other.member.powershell"
911
+ }
912
+ },
913
+ "comment": "These are the other built-in constants.",
914
+ "match": "(\\$)(?i:(Error|ExecutionContext|Host|Home|PID|PsHome|PsVersionTable|ShellID))\\b"
915
+ },
916
+ {
917
+ "captures": {
918
+ "0": {
919
+ "name": "support.variable.automatic.powershell"
920
+ },
921
+ "1": {
922
+ "name": "punctuation.definition.variable.powershell"
923
+ },
924
+ "3": {
925
+ "name": "variable.other.member.powershell"
926
+ }
927
+ },
928
+ "comment": "Automatic variables are not constants, but they are read-only...",
929
+ "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)"
930
+ },
931
+ {
932
+ "captures": {
933
+ "0": {
934
+ "name": "variable.language.powershell"
935
+ },
936
+ "1": {
937
+ "name": "punctuation.definition.variable.powershell"
938
+ },
939
+ "3": {
940
+ "name": "variable.other.member.powershell"
941
+ }
942
+ },
943
+ "comment": "Style preference variables as language variables so that they stand out.",
944
+ "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"
945
+ },
946
+ {
947
+ "captures": {
948
+ "0": {
949
+ "name": "variable.other.readwrite.powershell"
950
+ },
951
+ "1": {
952
+ "name": "punctuation.definition.variable.powershell"
953
+ },
954
+ "2": {
955
+ "name": "storage.modifier.scope.powershell"
956
+ },
957
+ "4": {
958
+ "name": "variable.other.member.powershell"
959
+ }
960
+ },
961
+ "match": "(?i:(\\$)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))"
962
+ },
963
+ {
964
+ "captures": {
965
+ "0": {
966
+ "name": "variable.other.readwrite.powershell"
967
+ },
968
+ "1": {
969
+ "name": "punctuation.definition.variable.powershell"
970
+ },
971
+ "2": {
972
+ "name": "storage.modifier.scope.powershell"
973
+ },
974
+ "4": {
975
+ "name": "keyword.other.powershell"
976
+ },
977
+ "5": {
978
+ "name": "variable.other.member.powershell"
979
+ }
980
+ },
981
+ "match": "(?i:(\\$)(\\{)(global|local|private|script|using|workflow):([^}]*[^}`])(\\}))"
982
+ },
983
+ {
984
+ "captures": {
985
+ "0": {
986
+ "name": "variable.other.readwrite.powershell"
987
+ },
988
+ "1": {
989
+ "name": "punctuation.definition.variable.powershell"
990
+ },
991
+ "2": {
992
+ "name": "support.variable.drive.powershell"
993
+ },
994
+ "4": {
995
+ "name": "variable.other.member.powershell"
996
+ }
997
+ },
998
+ "match": "(?i:(\\$)((?:\\p{L}|\\d|_)+:)?((?:\\p{L}|\\d|_)+))"
999
+ },
1000
+ {
1001
+ "captures": {
1002
+ "0": {
1003
+ "name": "variable.other.readwrite.powershell"
1004
+ },
1005
+ "1": {
1006
+ "name": "punctuation.definition.variable.powershell"
1007
+ },
1008
+ "2": {
1009
+ "name": "punctuation.section.braces.begin"
1010
+ },
1011
+ "3": {
1012
+ "name": "support.variable.drive.powershell"
1013
+ },
1014
+ "5": {
1015
+ "name": "punctuation.section.braces.end"
1016
+ }
1017
+ },
1018
+ "match": "(?i:(\\$)(\\{)((?:\\p{L}|\\d|_)+:)?([^}]*[^}`])(\\}))"
1019
+ }
1020
+ ]
1021
+ }
1022
+ },
1023
+ "scopeName": "source.powershell"
1024
+ }