|
148 | 148 | <dict>
|
149 | 149 | <key>begin</key>
|
150 | 150 | <string>(\@?\()</string>
|
151 |
| - <key>captures</key> |
| 151 | + <key>beginCaptures</key> |
152 | 152 | <dict>
|
153 | 153 | <key>0</key>
|
154 | 154 | <dict>
|
|
157 | 157 | </dict>
|
158 | 158 | </dict>
|
159 | 159 | <key>end</key>
|
160 |
| - <string>(\))</string> |
| 160 | + <string>(\))((\.[\w"']+)*)</string> |
| 161 | + <key>endCaptures</key> |
| 162 | + <dict> |
| 163 | + <key>1</key> |
| 164 | + <dict> |
| 165 | + <key>name</key> |
| 166 | + <string>keyword.other.powershell</string> |
| 167 | + </dict> |
| 168 | + <key>2</key> |
| 169 | + <dict> |
| 170 | + <key>name</key> |
| 171 | + <string>entity.other.attribute-name.powershell</string> |
| 172 | + </dict> |
| 173 | + </dict> |
161 | 174 | <key>name</key>
|
162 | 175 | <string>meta.array.powershell</string>
|
163 | 176 | <key>patterns</key>
|
|
254 | 267 | <array>
|
255 | 268 | <dict>
|
256 | 269 | <key>begin</key>
|
257 |
| - <string>(?<!\\)\b((?i:(Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Mount|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Write))-(\w+))\b</string> |
| 270 | + <string>(?<!\\)\b((?i:(Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Mount|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Write))-(\w+))\b(?!\.|\\)</string> |
258 | 271 | <key>beginCaptures</key>
|
259 | 272 | <dict>
|
260 | 273 | <key>1</key>
|
|
264 | 277 | </dict>
|
265 | 278 | </dict>
|
266 | 279 | <key>comment</key>
|
267 |
| - <string>Verb-Noun</string> |
| 280 | + <string>Generic function match based on Verb-Noun pair using list of approved verbs.</string> |
268 | 281 | <key>end</key>
|
269 |
| - <string>((?=\))|(?<!`)\n|(?<!`)\r|(\|))</string> |
| 282 | + <string>((?=\))|(?=\})|(?<!`)\n|(?<!`)\r|(\|))</string> |
270 | 283 | <key>endCaptures</key>
|
271 | 284 | <dict>
|
272 | 285 | <key>2</key>
|
|
279 | 292 | <string>meta.command.powershell</string>
|
280 | 293 | <key>patterns</key>
|
281 | 294 | <array>
|
| 295 | + <dict> |
| 296 | + <key>include</key> |
| 297 | + <string>#scriptblock</string> |
| 298 | + </dict> |
| 299 | + <dict> |
| 300 | + <key>include</key> |
| 301 | + <string>#commandParameter</string> |
| 302 | + </dict> |
| 303 | + <dict> |
| 304 | + <key>include</key> |
| 305 | + <string>#lineComment</string> |
| 306 | + </dict> |
| 307 | + <dict> |
| 308 | + <key>include</key> |
| 309 | + <string>#redirection</string> |
| 310 | + </dict> |
| 311 | + <dict> |
| 312 | + <key>include</key> |
| 313 | + <string>#numericConstant</string> |
| 314 | + </dict> |
| 315 | + <dict> |
| 316 | + <key>include</key> |
| 317 | + <string>#operators</string> |
| 318 | + </dict> |
| 319 | + <dict> |
| 320 | + <key>include</key> |
| 321 | + <string>#variable</string> |
| 322 | + </dict> |
| 323 | + <dict> |
| 324 | + <key>include</key> |
| 325 | + <string>#stringDoubleQuoted</string> |
| 326 | + </dict> |
| 327 | + <dict> |
| 328 | + <key>include</key> |
| 329 | + <string>#stringSingleQuoted</string> |
| 330 | + </dict> |
| 331 | + <dict> |
| 332 | + <key>include</key> |
| 333 | + <string>#arrayDeclaration</string> |
| 334 | + </dict> |
| 335 | + <dict> |
| 336 | + <key>include</key> |
| 337 | + <string>#illegalBacktick</string> |
| 338 | + </dict> |
| 339 | + <dict> |
| 340 | + <key>include</key> |
| 341 | + <string>#illegalVariable</string> |
| 342 | + </dict> |
| 343 | + </array> |
| 344 | + </dict> |
| 345 | + <dict> |
| 346 | + <key>begin</key> |
| 347 | + <string>(?<!\\)\b(?i:foreach-object|tee-object|where-object|sort-object)\b(?!\.|\\)</string> |
| 348 | + <key>beginCaptures</key> |
| 349 | + <dict> |
| 350 | + <key>0</key> |
| 351 | + <dict> |
| 352 | + <key>name</key> |
| 353 | + <string>support.function.powershell</string> |
| 354 | + </dict> |
| 355 | + </dict> |
| 356 | + <key>comment</key> |
| 357 | + <string>Built-in commands that don't adhere to the approved verbs standard.</string> |
| 358 | + <key>end</key> |
| 359 | + <string>((?=\))|(?=\})|(?<!`)\n|(?<!`)\r|(\|))</string> |
| 360 | + <key>endCaptures</key> |
| 361 | + <dict> |
| 362 | + <key>2</key> |
| 363 | + <dict> |
| 364 | + <key>name</key> |
| 365 | + <string>keyword.operator.powershell</string> |
| 366 | + </dict> |
| 367 | + </dict> |
| 368 | + <key>name</key> |
| 369 | + <string>meta.command.powershell</string> |
| 370 | + <key>patterns</key> |
| 371 | + <array> |
| 372 | + <dict> |
| 373 | + <key>include</key> |
| 374 | + <string>#scriptblock</string> |
| 375 | + </dict> |
| 376 | + <dict> |
| 377 | + <key>include</key> |
| 378 | + <string>#commandParameter</string> |
| 379 | + </dict> |
| 380 | + <dict> |
| 381 | + <key>include</key> |
| 382 | + <string>#lineComment</string> |
| 383 | + </dict> |
| 384 | + <dict> |
| 385 | + <key>include</key> |
| 386 | + <string>#redirection</string> |
| 387 | + </dict> |
| 388 | + <dict> |
| 389 | + <key>include</key> |
| 390 | + <string>#numericConstant</string> |
| 391 | + </dict> |
| 392 | + <dict> |
| 393 | + <key>include</key> |
| 394 | + <string>#operators</string> |
| 395 | + </dict> |
| 396 | + <dict> |
| 397 | + <key>include</key> |
| 398 | + <string>#variable</string> |
| 399 | + </dict> |
| 400 | + <dict> |
| 401 | + <key>include</key> |
| 402 | + <string>#stringDoubleQuoted</string> |
| 403 | + </dict> |
| 404 | + <dict> |
| 405 | + <key>include</key> |
| 406 | + <string>#stringSingleQuoted</string> |
| 407 | + </dict> |
| 408 | + <dict> |
| 409 | + <key>include</key> |
| 410 | + <string>#arrayDeclaration</string> |
| 411 | + </dict> |
| 412 | + <dict> |
| 413 | + <key>include</key> |
| 414 | + <string>#illegalBacktick</string> |
| 415 | + </dict> |
| 416 | + <dict> |
| 417 | + <key>include</key> |
| 418 | + <string>#illegalVariable</string> |
| 419 | + </dict> |
| 420 | + </array> |
| 421 | + </dict> |
| 422 | + <dict> |
| 423 | + <key>begin</key> |
| 424 | + <string>(?<!\\|\[)\b(?i:ac|asnp|cat|cd|cfs|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|curl|cvpa|dbp|del|diff|dir|dnsn|ebp|echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fhx|fl|ft|fw|gal|gbp|gc|gcb|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps|gpv|group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md|measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri|rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|scb|select|set|shcm|si|sl|sleep|sls|sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|wget|wjb|write)\b(?!\.|\\|\])</string> |
| 425 | + <key>beginCaptures</key> |
| 426 | + <dict> |
| 427 | + <key>0</key> |
| 428 | + <dict> |
| 429 | + <key>name</key> |
| 430 | + <string>support.function.powershell</string> |
| 431 | + </dict> |
| 432 | + </dict> |
| 433 | + <key>comment</key> |
| 434 | + <string>Built-in aliases</string> |
| 435 | + <key>end</key> |
| 436 | + <string>((?=\))|(?=\})|(?<!`)\n|(?<!`)\r|(\|))</string> |
| 437 | + <key>endCaptures</key> |
| 438 | + <dict> |
| 439 | + <key>2</key> |
| 440 | + <dict> |
| 441 | + <key>name</key> |
| 442 | + <string>keyword.operator.powershell</string> |
| 443 | + </dict> |
| 444 | + </dict> |
| 445 | + <key>name</key> |
| 446 | + <string>meta.command.powershell</string> |
| 447 | + <key>patterns</key> |
| 448 | + <array> |
| 449 | + <dict> |
| 450 | + <key>include</key> |
| 451 | + <string>#scriptblock</string> |
| 452 | + </dict> |
| 453 | + <dict> |
| 454 | + <key>include</key> |
| 455 | + <string>#commandParameter</string> |
| 456 | + </dict> |
| 457 | + <dict> |
| 458 | + <key>include</key> |
| 459 | + <string>#lineComment</string> |
| 460 | + </dict> |
| 461 | + <dict> |
| 462 | + <key>include</key> |
| 463 | + <string>#redirection</string> |
| 464 | + </dict> |
| 465 | + <dict> |
| 466 | + <key>include</key> |
| 467 | + <string>#numericConstant</string> |
| 468 | + </dict> |
| 469 | + <dict> |
| 470 | + <key>include</key> |
| 471 | + <string>#operators</string> |
| 472 | + </dict> |
| 473 | + <dict> |
| 474 | + <key>include</key> |
| 475 | + <string>#variable</string> |
| 476 | + </dict> |
| 477 | + <dict> |
| 478 | + <key>include</key> |
| 479 | + <string>#stringDoubleQuoted</string> |
| 480 | + </dict> |
| 481 | + <dict> |
| 482 | + <key>include</key> |
| 483 | + <string>#stringSingleQuoted</string> |
| 484 | + </dict> |
| 485 | + <dict> |
| 486 | + <key>include</key> |
| 487 | + <string>#arrayDeclaration</string> |
| 488 | + </dict> |
| 489 | + <dict> |
| 490 | + <key>include</key> |
| 491 | + <string>#illegalBacktick</string> |
| 492 | + </dict> |
| 493 | + <dict> |
| 494 | + <key>include</key> |
| 495 | + <string>#illegalVariable</string> |
| 496 | + </dict> |
| 497 | + </array> |
| 498 | + </dict> |
| 499 | + <dict> |
| 500 | + <key>begin</key> |
| 501 | + <string>(\b(([A-Za-z0-9\-_\.]+).(?i:ps1))\b)</string> |
| 502 | + <key>beginCaptures</key> |
| 503 | + <dict> |
| 504 | + <key>0</key> |
| 505 | + <dict> |
| 506 | + <key>name</key> |
| 507 | + <string>support.function.powershell</string> |
| 508 | + </dict> |
| 509 | + </dict> |
| 510 | + <key>comment</key> |
| 511 | + <string>Calling external script</string> |
| 512 | + <key>end</key> |
| 513 | + <string>((?=\))|(?=\})|(?<!`)\n|(?<!`)\r|(\|))</string> |
| 514 | + <key>endCaptures</key> |
| 515 | + <dict> |
| 516 | + <key>2</key> |
| 517 | + <dict> |
| 518 | + <key>name</key> |
| 519 | + <string>keyword.operator.powershell</string> |
| 520 | + </dict> |
| 521 | + </dict> |
| 522 | + <key>name</key> |
| 523 | + <string>meta.command.powershell</string> |
| 524 | + <key>patterns</key> |
| 525 | + <array> |
| 526 | + <dict> |
| 527 | + <key>include</key> |
| 528 | + <string>#scriptblock</string> |
| 529 | + </dict> |
282 | 530 | <dict>
|
283 | 531 | <key>include</key>
|
284 | 532 | <string>#commandParameter</string>
|
|
641 | 889 | <key>executableFiles</key>
|
642 | 890 | <dict>
|
643 | 891 | <key>comment</key>
|
644 |
| - <string>Executable files, like exe, com, ps1, cmd and bat</string> |
| 892 | + <string>Executable files, like exe, com, cmd and bat</string> |
645 | 893 | <key>match</key>
|
646 |
| - <string>(\b(([A-Za-z0-9\-_\.]+).(?i:exe|com|ps1|cmd|bat))\b)</string> |
| 894 | + <string>(\b(([A-Za-z0-9\-_\.]+).(?i:exe|com|cmd|bat))\b)</string> |
647 | 895 | <key>name</key>
|
648 | 896 | <string>support.function.powershell</string>
|
649 | 897 | </dict>
|
|
1104 | 1352 | <key>comment</key>
|
1105 | 1353 | <string>Type []</string>
|
1106 | 1354 | <key>end</key>
|
1107 |
| - <string>\]</string> |
| 1355 | + <string>(\])(::[\w]+)*((\.[\w"']+)*)</string> |
1108 | 1356 | <key>endCaptures</key>
|
1109 | 1357 | <dict>
|
1110 |
| - <key>0</key> |
| 1358 | + <key>1</key> |
1111 | 1359 | <dict>
|
1112 | 1360 | <key>name</key>
|
1113 | 1361 | <string>keyword.other.powershell</string>
|
1114 | 1362 | </dict>
|
| 1363 | + <key>2</key> |
| 1364 | + <dict> |
| 1365 | + <key>name</key> |
| 1366 | + <string>meta.method.powershell</string> |
| 1367 | + </dict> |
| 1368 | + <key>3</key> |
| 1369 | + <dict> |
| 1370 | + <key>name</key> |
| 1371 | + <string>entity.other.attribute-name.powershell</string> |
| 1372 | + </dict> |
1115 | 1373 | </dict>
|
1116 | 1374 | <key>patterns</key>
|
1117 | 1375 | <array>
|
|
1209 | 1467 | <key>name</key>
|
1210 | 1468 | <string>variable.other.readwrite.powershell</string>
|
1211 | 1469 | </dict>
|
| 1470 | + <key>5</key> |
| 1471 | + <dict> |
| 1472 | + <key>name</key> |
| 1473 | + <string>entity.other.attribute-name.powershell</string> |
| 1474 | + </dict> |
1212 | 1475 | </dict>
|
1213 | 1476 | <key>comment</key>
|
1214 | 1477 | <string>$var, $local:var</string>
|
1215 | 1478 | <key>match</key>
|
1216 |
| - <string>(\$)((?i:global|local|script|private|using|env|function|alias|cert|variable|hkcu|hklm|wsman):)?(\w+)(:\w+)?</string> |
| 1479 | + <string>(\$)((?i:global|local|script|private|using|env|function|alias|cert|variable|hkcu|hklm|wsman):)?(\w+)(:\w+)?((\.[\w"']+)*)</string> |
1217 | 1480 | </dict>
|
1218 | 1481 | <dict>
|
1219 | 1482 | <key>captures</key>
|
|
1243 | 1506 | <key>name</key>
|
1244 | 1507 | <string>keyword.other.powershell</string>
|
1245 | 1508 | </dict>
|
| 1509 | + <key>6</key> |
| 1510 | + <dict> |
| 1511 | + <key>name</key> |
| 1512 | + <string>entity.other.attribute-name.powershell</string> |
| 1513 | + </dict> |
1246 | 1514 | </dict>
|
1247 | 1515 | <key>comment</key>
|
1248 | 1516 | <string>${var}, ${script:var}</string>
|
1249 | 1517 | <key>match</key>
|
1250 |
| - <string>(\$)(\{)((?i:global|local|script|private|using|env|function|alias|cert|variable|hkcu|hklm|wsman):)?(.+)(\})</string> |
| 1518 | + <string>(\$)(\{)((?i:global|local|script|private|using|env|function|alias|cert|variable|hkcu|hklm|wsman):)?(.+)(\})((\.[\w"']+)*)</string> |
1251 | 1519 | </dict>
|
1252 | 1520 | <dict>
|
1253 | 1521 | <key>captures</key>
|
|
0 commit comments