@@ -50,7 +50,6 @@ contexts:
5050 - include : expressions
5151 - include : functions
5252
53- # TODO: Continue into a command statement
5453 - match : \B\.(?= )
5554 scope : support.function.source.powershell
5655
@@ -118,8 +117,6 @@ contexts:
118117 - include : groups
119118 - include : arrays
120119 - include : subexpressions
121- - match : \b[\w.-]+\.(?i:exe|com|cmd|bat)\b
122- scope : variable.function.powershell
123120
124121 # Consume a string with a trailing dot
125122 # to prevent members with particular names from being recognized as keywords.
@@ -178,20 +175,6 @@ contexts:
178175 3 : keyword.other.region.end.powershell
179176 4 : meta.fold.end.powershell
180177
181- commands :
182- # The "Verb-Noun" pattern
183- - match : |-
184- (?x:
185- (?:[\w\\:-]*\\)? # Path stuff
186- {{command_verbs}} # Approved verbs
187- \-\w+? # Any "noun"
188- (?:\.(?i:exe|cmd|bat|ps1))?\b # More path stuff
189- )
190- scope: meta.function-call.powershell support.function.powershell
191- # Builtin cmdlets with reserved verbs
192- - match : \b(?i:(?:foreach|where|sort|tee)-object)\b
193- scope : support.function.powershell
194-
195178 script-blocks :
196179 - match : (%)?(\{)
197180 captures :
@@ -215,6 +198,33 @@ contexts:
215198 # Back to normal stuff
216199 - include : statements
217200
201+ # ##[ COMMANDS ]################################################################
202+
203+ commands :
204+ - include : commands-verb-noun
205+ - include : commands-reserved
206+ - include : script-invocation
207+
208+ commands-verb-noun :
209+ # The "Verb-Noun" pattern
210+ - match : |-
211+ (?x:
212+ (?:[.\w\\/:-]*[\\/])? # Path stuff
213+ {{command_verbs}} # Approved verbs
214+ \-\w+? # Any "noun"
215+ (?:\.(?i:exe|cmd|bat|ps1))?\b # More path stuff
216+ )
217+ scope: meta.function-call.powershell support.function.powershell
218+
219+ commands-reserved :
220+ # Builtin cmdlets with reserved verbs
221+ - match : \b(?i:(?:foreach|where|sort|tee)-object)\b
222+ scope : support.function.powershell
223+
224+ script-invocation :
225+ - match : \b[\w.\\/-]+\.(?i:exe|com|cmd|bat|ps1)\b
226+ scope : variable.function.powershell
227+
218228# ##[ USINGS ]##################################################################
219229
220230 using-directives :
0 commit comments