@@ -76,70 +76,72 @@ contexts:
76
76
- match : \b[\w.-]+\.(?i:exe|com|cmd|bat)\b
77
77
scope : variable.function.powershell
78
78
# Exceptions
79
- - match : \b(?i:throw){{kebab_break}}
79
+ - match : (?<![.]) \b(?i:throw){{kebab_break}}
80
80
scope : keyword.control.exception.raise.powershell
81
- - match : \b(?i:try){{kebab_break}}
81
+ - match : (?<![.]) \b(?i:try){{kebab_break}}
82
82
scope : keyword.control.exception.try.powershell
83
- - match : \b(?i:catch|trap){{kebab_break}}
83
+ - match : (?<![.]) \b(?i:catch|trap){{kebab_break}}
84
84
scope : keyword.control.exception.catch.powershell
85
- - match : \b(?i:finally){{kebab_break}}
85
+ - match : (?<![.]) \b(?i:finally){{kebab_break}}
86
86
scope : keyword.control.exception.finally.powershell
87
87
# Conditionals
88
- - match : \b(?i:if){{kebab_break}}
88
+ - match : (?<![.]) \b(?i:if){{kebab_break}}
89
89
scope : keyword.control.conditional.if.powershell
90
- - match : \b(?i:elseif){{kebab_break}}
90
+ - match : (?<![.]) \b(?i:elseif){{kebab_break}}
91
91
scope : keyword.control.conditional.elseif.powershell
92
- - match : \b(?i:else){{kebab_break}}
92
+ - match : (?<![.]) \b(?i:else){{kebab_break}}
93
93
scope : keyword.control.conditional.else.powershell
94
- - match : \b(?i:switch){{kebab_break}}
94
+ - match : (?<![.]) \b(?i:switch){{kebab_break}}
95
95
scope : keyword.control.conditional.switch.powershell
96
96
- match : \?
97
97
scope : keyword.control.conditional.select.powershell
98
98
- match : \b(?i:where(?!-object)){{kebab_break}}
99
99
scope : keyword.control.conditional.select.powershell
100
100
# Begin/End
101
- - match : \b(?i:begin){{kebab_break}}
101
+ - match : (?<![.]) \b(?i:begin){{kebab_break}}
102
102
scope : keyword.context.block.begin.powershell
103
- - match : \b(?i:end){{kebab_break}}
103
+ - match : (?<![.])\b(?i:process){{kebab_break}}
104
+ scope : keyword.context.block.process.powershell
105
+ - match : (?<![.])\b(?i:end){{kebab_break}}
104
106
scope : keyword.context.block.end.powershell
105
- - match : \b(?i:clean){{kebab_break}}
107
+ - match : (?<![.]) \b(?i:clean){{kebab_break}}
106
108
scope : keyword.context.block.clean.powershell
107
109
# Loops
108
110
- match : \b(?i:for|foreach(?!-object)){{kebab_break}}
109
111
scope : keyword.control.loop.for.powershell
110
- - match : \b(?i:do){{kebab_break}}
112
+ - match : (?<![.]) \b(?i:do){{kebab_break}}
111
113
scope : keyword.control.loop.do-while.powershell
112
- - match : \b(?i:while){{kebab_break}}
114
+ - match : (?<![.]) \b(?i:while){{kebab_break}}
113
115
scope : keyword.control.loop.while.powershell
114
- - match : \b(?i:until){{kebab_break}}
116
+ - match : (?<![.]) \b(?i:until){{kebab_break}}
115
117
scope : keyword.control.loop.repeat-until.powershell
116
118
# Flow
117
- - match : \b(?i:break){{kebab_break}}
119
+ - match : (?<![.]) \b(?i:break){{kebab_break}}
118
120
scope : keyword.control.flow.break.powershell
119
- - match : \b(?i:continue){{kebab_break}}
121
+ - match : (?<![.]) \b(?i:continue){{kebab_break}}
120
122
scope : keyword.control.flow.continue.powershell
121
- - match : \b(?i:exit){{kebab_break}}
123
+ - match : (?<![.]) \b(?i:exit){{kebab_break}}
122
124
scope : keyword.control.flow.exit.powershell
123
- - match : \b(?i:return){{kebab_break}}
125
+ - match : (?<![.]) \b(?i:return){{kebab_break}}
124
126
scope : keyword.control.flow.return.powershell
125
127
# Declaration
126
- - match : \b(?i:var){{kebab_break}}
128
+ - match : (?<![.]) \b(?i:var){{kebab_break}}
127
129
# scope: storage.type.variable.powershell
128
130
scope : keyword.declaration.variable.powershell
129
- - match : \b(?i:(?:dynamic)?param){{kebab_break}}
131
+ - match : (?<![.]) \b(?i:(?:dynamic)?param){{kebab_break}}
130
132
scope : keyword.declaration.parameter.powershell # This scope is not standard
131
133
# Uncategorized keywords
132
- - match : \b(?i:data|default|define|from|in|inlinescript|parallel|process ){{kebab_break}}
134
+ - match : (?<![.]) \b(?i:data|default|define|from|in|inlinescript|parallel){{kebab_break}}
133
135
scope : keyword.control.powershell
134
136
- match : \B--%\B
135
137
scope : keyword.control.powershell
136
138
push :
137
139
- meta_content_scope : string.unquoted.powershell
138
140
- include : pop-before-newline
139
- - match : \b(?i:hidden|static)\b
141
+ - match : (?<![.]) \b(?i:hidden|static)\b
140
142
# This should only be relevant inside a class but will require a rework of how classes are matched. This is a temp fix.
141
143
scope : storage.modifier.powershell
142
- - match : \b((?i:class))\s+([\w-]+)\b
144
+ - match : (?<![.]) \b((?i:class))\s+([\w-]+)\b
143
145
captures :
144
146
1 : storage.type.class.powershell
145
147
2 : meta.class.powershell entity.name.class.powershell
0 commit comments