Skip to content

Commit f23d507

Browse files
author
bcrotty
committed
Update PowershellSyntax.tmLanguage
Fixes several issues: 229: Correctly highlights the operators -clt, -cle, -cgt, cge 235: Fixes issues highlighting paths with symbols in them 259 & 265: Fixes issues with operator highlighting, such as -NoTypeInformation being incorrectly highlighted as two elements, but allows for -Not1 to be correctly interpreted as two elements 393: Allows for permissible symbols in command names
1 parent c03b2d4 commit f23d507

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Support/PowershellSyntax.tmLanguage

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@
226226
</dict>
227227
<dict>
228228
<key>match</key>
229-
<string>-([lg][te]|[ci]?(eq|ne))</string>
229+
<string>-([ci]?[lg][te]|eq|ne)</string>
230230
<key>name</key>
231231
<string>keyword.operator.logical.powershell</string>
232232
</dict>
233233
<dict>
234234
<key>match</key>
235-
<string>(?i:[a-z][a-z0-9]+-?[a-z][a-z0-9]+)(?i:\.(?:exe|cmd|bat|ps1))</string>
235+
<string>(?i:\S+)(?i:\.(?:exe|cmd|bat|ps1))</string>
236236
<key>name</key>
237237
<string>support.function.powershell</string>
238238
</dict>
@@ -256,13 +256,13 @@
256256
</dict>
257257
<dict>
258258
<key>match</key>
259-
<string>-(?i:join|split)|!</string>
259+
<string>-(?i:join|split)(?!\p{L})|!</string>
260260
<key>name</key>
261261
<string>keyword.operator.unary.powershell</string>
262262
</dict>
263263
<dict>
264264
<key>match</key>
265-
<string>-(?i:and|or|not|xor)|!</string>
265+
<string>-(?i:and|or|not|xor)(?!\p{L})|!</string>
266266
<key>name</key>
267267
<string>keyword.operator.logical.powershell</string>
268268
</dict>
@@ -390,7 +390,7 @@
390390
<key>comment</key>
391391
<string>Verb-Noun pattern:</string>
392392
<key>match</key>
393-
<string>(?:[a-zA-Z.]*\\)?(?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)\-.+?(?:\.(?:exe|cmd|bat|ps1))?\b</string>
393+
<string>(?:(\p{L}|\d|_|-|\\|\:)*\\)?\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)\-.+?(?:\.(?:exe|cmd|bat|ps1))?\b</string>
394394
<key>name</key>
395395
<string>support.function.powershell</string>
396396
</dict>

0 commit comments

Comments
 (0)