|
105 | 105 | <key>include</key>
|
106 | 106 | <string>#function</string>
|
107 | 107 | </dict>
|
| 108 | + <dict> |
| 109 | + <key>include</key> |
| 110 | + <string>#enum</string> |
| 111 | + </dict> |
108 | 112 | <dict>
|
109 | 113 | <key>include</key>
|
110 | 114 | <string>#class</string>
|
|
191 | 195 | </dict>
|
192 | 196 | <key>class</key>
|
193 | 197 | <dict>
|
194 |
| - <key>captures</key> |
| 198 | + <key>begin</key> |
| 199 | + <string>(?<!\w|-)(?i:(class))\s+(\w+)(?:\s*(:)\s*(\w+))?\s*\{</string> |
| 200 | + <key>beginCaptures</key> |
195 | 201 | <dict>
|
196 | 202 | <key>1</key>
|
197 | 203 | <dict>
|
|
201 | 207 | <key>2</key>
|
202 | 208 | <dict>
|
203 | 209 | <key>name</key>
|
204 |
| - <string>entity.name.function</string> |
| 210 | + <string>entity.name.function.powershell</string> |
| 211 | + </dict> |
| 212 | + <key>3</key> |
| 213 | + <dict> |
| 214 | + <key>name</key> |
| 215 | + <string>keyword.operator.powershell</string> |
| 216 | + </dict> |
| 217 | + <key>4</key> |
| 218 | + <dict> |
| 219 | + <key>name</key> |
| 220 | + <string>entity.other.inherited-class.powershell</string> |
205 | 221 | </dict>
|
206 | 222 | </dict>
|
207 | 223 | <key>comment</key>
|
208 |
| - <string>capture should be entity.name.type, but it doesn't provide a good color in the default schema.</string> |
| 224 | + <string>Class</string> |
| 225 | + <key>end</key> |
| 226 | + <string>\}</string> |
| 227 | + <key>name</key> |
| 228 | + <string>meta.class.powershell</string> |
| 229 | + <key>patterns</key> |
| 230 | + <array> |
| 231 | + <dict> |
| 232 | + <key>include</key> |
| 233 | + <string>#classReservedWords</string> |
| 234 | + </dict> |
| 235 | + <dict> |
| 236 | + <key>include</key> |
| 237 | + <string>#classBaseKeyword</string> |
| 238 | + </dict> |
| 239 | + <dict> |
| 240 | + <key>include</key> |
| 241 | + <string>$self</string> |
| 242 | + </dict> |
| 243 | + </array> |
| 244 | + </dict> |
| 245 | + <key>classBaseKeyword</key> |
| 246 | + <dict> |
| 247 | + <key>captures</key> |
| 248 | + <dict> |
| 249 | + <key>1</key> |
| 250 | + <dict> |
| 251 | + <key>name</key> |
| 252 | + <string>keyword.operator.powershell</string> |
| 253 | + </dict> |
| 254 | + <key>2</key> |
| 255 | + <dict> |
| 256 | + <key>name</key> |
| 257 | + <string>keyword.control.class.powershell</string> |
| 258 | + </dict> |
| 259 | + </dict> |
| 260 | + <key>comment</key> |
| 261 | + <string>The base keyword used in classes.</string> |
209 | 262 | <key>match</key>
|
210 |
| - <string>(?<!\w|-)(?i:(class|enum))\s+(\w+)\s+</string> |
| 263 | + <string>(:)\s*(?i:(base))\s*(?=\()</string> |
| 264 | + </dict> |
| 265 | + <key>classReservedWords</key> |
| 266 | + <dict> |
| 267 | + <key>comment</key> |
| 268 | + <string>Reserved words for classes.</string> |
| 269 | + <key>match</key> |
| 270 | + <string>\b(?i:(hidden|static))\b</string> |
| 271 | + <key>name</key> |
| 272 | + <string>keyword.other.powershell</string> |
211 | 273 | </dict>
|
212 | 274 | <key>commandParameter</key>
|
213 | 275 | <dict>
|
|
713 | 775 | <key>match</key>
|
714 | 776 | <string>(?i:(default))\s*(?=\{)</string>
|
715 | 777 | </dict>
|
| 778 | + <key>enum</key> |
| 779 | + <dict> |
| 780 | + <key>captures</key> |
| 781 | + <dict> |
| 782 | + <key>1</key> |
| 783 | + <dict> |
| 784 | + <key>name</key> |
| 785 | + <string>storage.type.powershell</string> |
| 786 | + </dict> |
| 787 | + <key>2</key> |
| 788 | + <dict> |
| 789 | + <key>name</key> |
| 790 | + <string>entity.name.function</string> |
| 791 | + </dict> |
| 792 | + </dict> |
| 793 | + <key>comment</key> |
| 794 | + <string>capture should be entity.name.type, but it doesn't provide a good color in the default schema.</string> |
| 795 | + <key>match</key> |
| 796 | + <string>(?<!\w|-)(?i:(enum))\s+(\w+)\s+</string> |
| 797 | + </dict> |
716 | 798 | <key>executableFiles</key>
|
717 | 799 | <dict>
|
718 | 800 | <key>comment</key>
|
|
990 | 1072 | <key>reservedWords</key>
|
991 | 1073 | <dict>
|
992 | 1074 | <key>match</key>
|
993 |
| - <string>(\b(?<!-|\$)(?i:configuration|node|process|enum|filter|sequence|class|switch|data|define|function|dynamicparam|inlinescript|var|parallel|param|workflow)\b(?!-|\.))</string> |
| 1075 | + <string>(\b(?<!-|\$)(?i:configuration|node|process|enum|filter|sequence|class|data|define|function|dynamicparam|inlinescript|var|parallel|param|workflow)\b(?!-|\.))</string> |
994 | 1076 | <key>name</key>
|
995 | 1077 | <string>keyword.other.powershell</string>
|
996 | 1078 | </dict>
|
|
0 commit comments