|
56 | 56 | <key>include</key>
|
57 | 57 | <string>#commentEmbeddedDocs</string>
|
58 | 58 | </dict>
|
| 59 | + <dict> |
| 60 | + <key>include</key> |
| 61 | + <string>#RequiresDirective</string> |
| 62 | + </dict> |
59 | 63 | </array>
|
60 | 64 | </dict>
|
61 | 65 | <dict>
|
|
84 | 88 | <key>include</key>
|
85 | 89 | <string>#attribute</string>
|
86 | 90 | </dict>
|
| 91 | + <dict> |
| 92 | + <key>include</key> |
| 93 | + <string>#UsingDirective</string> |
| 94 | + </dict> |
87 | 95 | <dict>
|
88 | 96 | <key>include</key>
|
89 | 97 | <string>#type</string>
|
|
246 | 254 | </dict>
|
247 | 255 | <dict>
|
248 | 256 | <key>match</key>
|
249 |
| - <string>(?<!\w)((?i:begin|break|catch|continue|data|define|do|dynamicparam|else|elseif|end|exit|finally|for|foreach(?!-object)|from|if|in|inlinescript|parallel|param|process|return|switch|throw|trap|try|until|using|var|where(?!-object)|while)|%|\?)(?!\w)</string> |
| 257 | + <string>(?<!\w)((?i:begin|break|catch|continue|data|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> |
250 | 258 | <key>name</key>
|
251 | 259 | <string>keyword.control.powershell</string>
|
252 | 260 | </dict>
|
| 261 | + <dict> |
| 262 | + <key>comment</key> |
| 263 | + <string>This should only be relevant inside a class but will require a rework of how classes are matched. This is a temp fix.</string> |
| 264 | + <key>match</key> |
| 265 | + <string>(?<!\w)((?i:hidden|static))(?!\w)</string> |
| 266 | + <key>name</key> |
| 267 | + <string>storage.modifier.powershell</string> |
| 268 | + </dict> |
253 | 269 | <dict>
|
254 | 270 | <key>captures</key>
|
255 | 271 | <dict>
|
|
499 | 515 | <key>name</key>
|
500 | 516 | <string>comment.documentation.embedded.powershell</string>
|
501 | 517 | </dict>
|
502 |
| - <dict> |
503 |
| - <key>captures</key> |
504 |
| - <dict> |
505 |
| - <key>1</key> |
506 |
| - <dict> |
507 |
| - <key>name</key> |
508 |
| - <string>constant.string.documentation.powershell</string> |
509 |
| - </dict> |
510 |
| - <key>2</key> |
511 |
| - <dict> |
512 |
| - <key>name</key> |
513 |
| - <string>keyword.operator.documentation.powershell</string> |
514 |
| - </dict> |
515 |
| - <key>3</key> |
516 |
| - <dict> |
517 |
| - <key>name</key> |
518 |
| - <string>string.quoted.double.heredoc.powershell</string> |
519 |
| - </dict> |
520 |
| - </dict> |
521 |
| - <key>match</key> |
522 |
| - <string>(?i:requires\s+-(Version\s+\d(.\d+)?|Assembly\s+(.*)|Module\s+(.*)|PsSnapIn\s+(.*)|ShellId\s+(.*)))</string> |
523 |
| - <key>name</key> |
524 |
| - <string>comment.documentation.embedded.powershell</string> |
525 |
| - </dict> |
526 | 518 | </array>
|
527 | 519 | </dict>
|
528 | 520 | <key>doubleQuotedStringEscapes</key>
|
|
1061 | 1053 | </dict>
|
1062 | 1054 | </array>
|
1063 | 1055 | </dict>
|
| 1056 | + <key>UsingDirective</key> |
| 1057 | + <dict> |
| 1058 | + <key>match</key> |
| 1059 | + <string>(?<!\w)(?i:(using))\s+(?i:(namespace|module))\s+(?i:((?:\w+(?:\.)?)+))</string> |
| 1060 | + <key>captures</key> |
| 1061 | + <dict> |
| 1062 | + <key>1</key> |
| 1063 | + <dict> |
| 1064 | + <key>name</key> |
| 1065 | + <string>keyword.control.using.powershell</string> |
| 1066 | + </dict> |
| 1067 | + <key>2</key> |
| 1068 | + <dict> |
| 1069 | + <key>name</key> |
| 1070 | + <string>keyword.other.powershell</string> |
| 1071 | + </dict> |
| 1072 | + <key>3</key> |
| 1073 | + <dict> |
| 1074 | + <key>name</key> |
| 1075 | + <string>variable.parameter.powershell</string> |
| 1076 | + </dict> |
| 1077 | + </dict> |
| 1078 | + </dict> |
| 1079 | + <key>RequiresDirective</key> |
| 1080 | + <dict> |
| 1081 | + <key>patterns</key> |
| 1082 | + <array> |
| 1083 | + <dict> |
| 1084 | + <key>match</key> |
| 1085 | + <string>(?i:(requires))\s(?i:(-Modules))\s(((?:\w+)\,?\s?){1,})$</string> |
| 1086 | + <key>captures</key> |
| 1087 | + <dict> |
| 1088 | + <key>0</key> |
| 1089 | + <dict> |
| 1090 | + <key>name</key> |
| 1091 | + <string>meta.requires.powershell</string> |
| 1092 | + </dict> |
| 1093 | + <key>1</key> |
| 1094 | + <dict> |
| 1095 | + <key>name</key> |
| 1096 | + <string>keyword.control.requires.powershell</string> |
| 1097 | + </dict> |
| 1098 | + <key>2</key> |
| 1099 | + <dict> |
| 1100 | + <key>name</key> |
| 1101 | + <string>keyword.other.powershell</string> |
| 1102 | + </dict> |
| 1103 | + <key>3</key> |
| 1104 | + <dict> |
| 1105 | + <key>name</key> |
| 1106 | + <string>variable.parameter.powershell</string> |
| 1107 | + </dict> |
| 1108 | + </dict> |
| 1109 | + </dict> |
| 1110 | + <dict> |
| 1111 | + <key>match</key> |
| 1112 | + <string>(?i:(requires))\s(?i:(-ShellId))\s(\w+)$</string> |
| 1113 | + <key>captures</key> |
| 1114 | + <dict> |
| 1115 | + <key>0</key> |
| 1116 | + <dict> |
| 1117 | + <key>name</key> |
| 1118 | + <string>meta.requires.powershell</string> |
| 1119 | + </dict> |
| 1120 | + <key>1</key> |
| 1121 | + <dict> |
| 1122 | + <key>name</key> |
| 1123 | + <string>keyword.control.requires.powershell</string> |
| 1124 | + </dict> |
| 1125 | + <key>2</key> |
| 1126 | + <dict> |
| 1127 | + <key>name</key> |
| 1128 | + <string>keyword.other.powershell</string> |
| 1129 | + </dict> |
| 1130 | + <key>3</key> |
| 1131 | + <dict> |
| 1132 | + <key>name</key> |
| 1133 | + <string>variable.parameter.powershell</string> |
| 1134 | + </dict> |
| 1135 | + </dict> |
| 1136 | + </dict> |
| 1137 | + <dict> |
| 1138 | + <key>match</key> |
| 1139 | + <string>(?i:(requires))\s(?i:(-RunAsAdministrator))$</string> |
| 1140 | + <key>captures</key> |
| 1141 | + <dict> |
| 1142 | + <key>0</key> |
| 1143 | + <dict> |
| 1144 | + <key>name</key> |
| 1145 | + <string>meta.requires.powershell</string> |
| 1146 | + </dict> |
| 1147 | + <key>1</key> |
| 1148 | + <dict> |
| 1149 | + <key>name</key> |
| 1150 | + <string>keyword.control.requires.powershell</string> |
| 1151 | + </dict> |
| 1152 | + <key>2</key> |
| 1153 | + <dict> |
| 1154 | + <key>name</key> |
| 1155 | + <string>keyword.other.powershell</string> |
| 1156 | + </dict> |
| 1157 | + </dict> |
| 1158 | + </dict> |
| 1159 | + <dict> |
| 1160 | + <key>match</key> |
| 1161 | + <string>(?i:(requires))\s(?i:(-Version))\s((?:\d\.?){1,})$</string> |
| 1162 | + <key>captures</key> |
| 1163 | + <dict> |
| 1164 | + <key>0</key> |
| 1165 | + <dict> |
| 1166 | + <key>name</key> |
| 1167 | + <string>meta.requires.powershell</string> |
| 1168 | + </dict> |
| 1169 | + <key>1</key> |
| 1170 | + <dict> |
| 1171 | + <key>name</key> |
| 1172 | + <string>keyword.control.requires.powershell</string> |
| 1173 | + </dict> |
| 1174 | + <key>2</key> |
| 1175 | + <dict> |
| 1176 | + <key>name</key> |
| 1177 | + <string>keyword.other.powershell</string> |
| 1178 | + </dict> |
| 1179 | + <key>3</key> |
| 1180 | + <dict> |
| 1181 | + <key>name</key> |
| 1182 | + <string>variable.parameter.powershell</string> |
| 1183 | + </dict> |
| 1184 | + </dict> |
| 1185 | + </dict> |
| 1186 | + <dict> |
| 1187 | + <key>match</key> |
| 1188 | + <string>(?i:(requires))(?:\s(-PSSnapin)\s(\w+))(?:\s(?i:(-Version))\s((?:\d\.?){1,}))?$</string> |
| 1189 | + <key>captures</key> |
| 1190 | + <dict> |
| 1191 | + <key>0</key> |
| 1192 | + <dict> |
| 1193 | + <key>name</key> |
| 1194 | + <string>meta.requires.powershell</string> |
| 1195 | + </dict> |
| 1196 | + <key>1</key> |
| 1197 | + <dict> |
| 1198 | + <key>name</key> |
| 1199 | + <string>keyword.control.requires.powershell</string> |
| 1200 | + </dict> |
| 1201 | + <key>2</key> |
| 1202 | + <dict> |
| 1203 | + <key>name</key> |
| 1204 | + <string>keyword.other.powershell</string> |
| 1205 | + </dict> |
| 1206 | + <key>3</key> |
| 1207 | + <dict> |
| 1208 | + <key>name</key> |
| 1209 | + <string>variable.parameter.powershell</string> |
| 1210 | + </dict> |
| 1211 | + <key>4</key> |
| 1212 | + <dict> |
| 1213 | + <key>name</key> |
| 1214 | + <string>keyword.other.powershell</string> |
| 1215 | + </dict> |
| 1216 | + <key>5</key> |
| 1217 | + <dict> |
| 1218 | + <key>name</key> |
| 1219 | + <string>variable.parameter.powershell</string> |
| 1220 | + </dict> |
| 1221 | + </dict> |
| 1222 | + </dict> |
| 1223 | + </array> |
| 1224 | + </dict> |
1064 | 1225 | <key>variableNoProperty</key>
|
1065 | 1226 | <dict>
|
1066 | 1227 | <key>patterns</key>
|
|
0 commit comments