Skip to content

Commit c2f90dc

Browse files
committed
rescope everything after --% PowerShell#113
1 parent ba1f906 commit c2f90dc

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

PowerShellSyntax.tmLanguage

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,29 @@
253253
<string>keyword.control.powershell</string>
254254
</dict>
255255
<dict>
256-
<key>match</key>
256+
<key>begin</key>
257257
<string>(?&lt;!\w)(--%)(?!\w)</string>
258-
<key>name</key>
259-
<string>keyword.control.powershell</string>
258+
<key>beginCaptures</key>
259+
<dict>
260+
<key>1</key>
261+
<dict>
262+
<key>name</key>
263+
<string>keyword.control.powershell</string>
264+
</dict>
265+
</dict>
266+
<key>end</key>
267+
<string>$</string>
268+
<key>patterns</key>
269+
<array>
270+
<dict>
271+
<key>match</key>
272+
<string>.+</string>
273+
<key>name</key>
274+
<string>string.unquoted.powershell</string>
275+
</dict>
276+
</array>
277+
<key>comment</key>
278+
<string>This should be moved to the repository at some point.</string>
260279
</dict>
261280
<dict>
262281
<key>comment</key>

spec/testfiles/syntax_test_TheBigTestFile.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ throw "Do not run this file!"
8484
& tool.exe /arg1 'value' /arg2 $value --% /arg3 $value /arg4 "value" # Comment
8585
# <- keyword.operator.other.powershell
8686
# ^^^^^^^^ support.function.powershell
87-
# ^ ^ ^ ^ keyword.operator.assignment.powershell
87+
# ^ ^ keyword.operator.assignment.powershell
8888
# ^^^ keyword.control.powershell
89+
# ^^ ^^ ^^ ^^ ^ ^ string.unquoted.powershell
8990

9091
# Automatic variables
9192
$_

0 commit comments

Comments
 (0)