Skip to content

Commit c2274d2

Browse files
committed
Add some formatting
1 parent 9f928fc commit c2274d2

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

PowerShell.sublime-syntax

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ contexts:
2828
- include: classes
2929
- include: expressions
3030
- include: functions
31+
32+
# TODO: Continue into a command statement
3133
- match: \B\.(?= )
3234
scope: support.function.source.powershell
35+
3336
# Exceptions
3437
- match: \b(?i:throw){{kebab_break}}
3538
scope: keyword.control.exception.raise.powershell
@@ -39,6 +42,7 @@ contexts:
3942
scope: keyword.control.exception.catch.powershell
4043
- match: \b(?i:finally){{kebab_break}}
4144
scope: keyword.control.exception.finally.powershell
45+
4246
# Loops
4347
- match: \b(?i:for|foreach(?!-object)){{kebab_break}}
4448
scope: keyword.control.loop.for.powershell
@@ -48,6 +52,7 @@ contexts:
4852
scope: keyword.control.loop.while.powershell
4953
- match: \b(?i:until){{kebab_break}}
5054
scope: keyword.control.loop.repeat-until.powershell
55+
5156
# Flow
5257
- match: \b(?i:break){{kebab_break}}
5358
scope: keyword.control.flow.break.powershell
@@ -57,6 +62,7 @@ contexts:
5762
scope: keyword.control.flow.exit.powershell
5863
- match: \b(?i:return){{kebab_break}}
5964
scope: keyword.control.flow.return.powershell
65+
6066
# Conditionals
6167
- match: \b(?i:if){{kebab_break}}
6268
scope: keyword.control.conditional.if.powershell
@@ -70,7 +76,8 @@ contexts:
7076
scope: keyword.control.conditional.select.powershell
7177
- match: \b(?i:where(?!-object)){{kebab_break}}
7278
scope: keyword.control.conditional.select.powershell
73-
# Declaration
79+
80+
# Declarations
7481
- match: \b(?i:var){{kebab_break}}
7582
scope: keyword.declaration.variable.powershell
7683
- match: \b(?i:(?:dynamic)?param){{kebab_break}}
@@ -95,14 +102,18 @@ contexts:
95102
- include: subexpressions
96103
- match: \b[\w.-]+\.(?i:exe|com|cmd|bat)\b
97104
scope: variable.function.powershell
105+
98106
# Consume a string with a trailing dot
99107
# to prevent members with particular names from being recognized as keywords.
100108
- match: \b[\w-]+(?=\.)
101109
scope: variable.other.object.powershell
102110
push: members
111+
103112
# Uncategorized keywords
104113
- match: \b(?i:data|default|define|from|in|inlinescript|parallel|sequence){{kebab_break}}
105114
scope: keyword.control.powershell
115+
116+
# Make everything afterward a literal
106117
- match: \B--%\B
107118
scope: keyword.control.powershell
108119
push:
@@ -196,13 +207,11 @@ contexts:
196207
scope: support.function.powershell
197208

198209
static-members:
199-
# - meta_content_scope: debug.in.static-members
200210
- match: '::'
201211
scope: punctuation.accessor.double-colon.powershell
202212
set: members
203213

204214
members:
205-
# - meta_content_scope: debug.in.members
206215
- match: (?=\.\.)
207216
pop: 1
208217
- match: \.(?=\w)
@@ -270,6 +279,7 @@ contexts:
270279
- match: \b(?i:clean){{kebab_break}}
271280
scope: keyword.context.block.clean.powershell
272281

282+
# Back to normal stuff
273283
- include: statements
274284

275285
types:

0 commit comments

Comments
 (0)