Skip to content

Commit 5d9c5b5

Browse files
authored
Merge pull request #101 from kborowinski/patch-3
Fix process keyword coloring
2 parents 8ec9066 + b31e5b5 commit 5d9c5b5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

PowerShellSyntax.tmLanguage

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,13 @@
242242
</dict>
243243
<dict>
244244
<key>match</key>
245-
<string>(?&lt;!\w|-)((?i:begin|break|catch|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|foreach(?!-object)|from|if|in|inlinescript|parallel|param|process|return|switch|throw|trap|try|until|var|where(?!-object)|while)|%|\?)(?!\w)</string>
245+
<string>(?&lt;!\w|-|\.)((?i:begin|break|catch|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|from|if|in|inlinescript|parallel|param|process|return|switch|throw|trap|try|until|var|while)|%|\?)(?!\w)</string>
246+
<key>name</key>
247+
<string>keyword.control.powershell</string>
248+
</dict>
249+
<dict>
250+
<key>match</key>
251+
<string>(?&lt;!\w|-|[^\)]\.)((?i:(foreach|where)(?!-object))|%|\?)(?!\w)</string>
246252
<key>name</key>
247253
<string>keyword.control.powershell</string>
248254
</dict>

spec/testfiles/syntax_test_TheBigTestFile.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,12 @@ $b -cLike $c
11101110
# ^ keyword.operator.string-format.powershell
11111111

11121112
# Misc test cases
1113+
Test-Function -Class ClassName
1114+
# ^ not:storage.type.powershell
1115+
New-Object -TypeName System.Diagnostics.Process
1116+
# ^ not:keyword.control.powershell
1117+
New-Object -TypeName System.Data
1118+
# ^ not:keyword.control.powershell
11131119
@("any","array","has").foreach({ $_ })
11141120
# <- keyword.other.array.begin.powershell
11151121
# ^ meta.group.array-expression.powershell

0 commit comments

Comments
 (0)