|
221 | 221 | { "include": "#comment" } |
222 | 222 | ] |
223 | 223 | }, |
| 224 | + "types": { |
| 225 | + "patterns": [ |
| 226 | + { |
| 227 | + "begin": "\\b(list)\\s*<", |
| 228 | + "beginCaptures": { |
| 229 | + "1": { "name": "entity.name.type.nushell" } |
| 230 | + }, |
| 231 | + "end": ">", |
| 232 | + "patterns": [ |
| 233 | + { "include": "#types" } |
| 234 | + ] |
| 235 | + }, |
| 236 | + { |
| 237 | + "begin": "\\b(record)\\s*<", |
| 238 | + "beginCaptures": { |
| 239 | + "1": { "name": "entity.name.type.nushell" } |
| 240 | + }, |
| 241 | + "end": ">", |
| 242 | + "patterns": [ |
| 243 | + { |
| 244 | + "match": "([\\w\\-]+|\"[\\w\\- ]+\"|'[^']+')\\s*:\\s*", |
| 245 | + "captures": { |
| 246 | + "1": { "name": "variable.parameter.nushell" } |
| 247 | + } |
| 248 | + }, |
| 249 | + { "include": "#types" } |
| 250 | + ] |
| 251 | + }, |
| 252 | + { |
| 253 | + "match": "\\b(\\w+)\\b", |
| 254 | + "name": "entity.name.type.nushell" |
| 255 | + } |
| 256 | + ] |
| 257 | + }, |
224 | 258 | "function-parameter-default-value": { |
225 | 259 | "begin": "=\\s*", |
226 | | - "captures": { |
227 | | - "1": { "name": "variable.parameter.nushell" }, |
228 | | - "2": { "name": "variable.parameter.nushell" }, |
229 | | - "3": { "name": "keyword.operator.nushell" }, |
230 | | - "4": { "name": "entity.name.type.nushell" } |
231 | | - }, |
232 | 260 | "end": "(?=\\])|,|$", |
233 | 261 | "patterns": [{ "include": "#value" }] |
234 | 262 | }, |
235 | 263 | "function-parameter-declare": { |
236 | | - "match": "(-{0,2}[\\w-]+|\\.{3})(?:\\((-[\\w?])\\))?(?:\\s*(\\??:)\\s*(\\w+)(?:@((?:\"[^\"]+\")|(?:'[^']+')))?)?", |
237 | | - "captures": { |
238 | | - "1": { "name": "variable.parameter.nushell" }, |
239 | | - "2": { "name": "variable.parameter.nushell" }, |
240 | | - "3": { "name": "keyword.operator.nushell" }, |
241 | | - "4": { "name": "entity.name.type.nushell" }, |
242 | | - "5": { "name": "string.quoted.nushell" } |
243 | | - } |
| 264 | + "patterns": [ |
| 265 | + { |
| 266 | + "match": "(-{0,2}[\\w-]+|\\.{3})(?:\\((-[\\w?])\\))?", |
| 267 | + "name": "variable.parameter.nushell" |
| 268 | + }, |
| 269 | + { |
| 270 | + "begin": "\\??:\\s*", |
| 271 | + "end": "\\s*(?=,|@|#|$)", |
| 272 | + "patterns": [ |
| 273 | + { "include": "#types" } |
| 274 | + ] |
| 275 | + }, |
| 276 | + { |
| 277 | + "begin": "@(?=\"|')", |
| 278 | + "end": "(?<=\"|')", |
| 279 | + "patterns": [ {"include": "#string"} ] |
| 280 | + } |
| 281 | + ] |
244 | 282 | }, |
245 | 283 | "function-parameter": { |
246 | 284 | "patterns": [ |
|
264 | 302 | "name": "meta.function.parameters.nushell" |
265 | 303 | }, |
266 | 304 | "inout": { |
267 | | - "match": "(\\w+|\\w+<\\w+>)\\s*->\\s*(\\w+|\\w+<\\w+>)\\s*(,)?\\s*", |
268 | | - "captures": { |
269 | | - "1": { "name": "entity.name.type.nushell" }, |
270 | | - "2": { "name": "entity.name.type.nushell" }, |
271 | | - "3": { "name": "punctuation.separator.nushell" } |
272 | | - } |
| 305 | + "patterns": [ |
| 306 | + { "include": "#types" }, |
| 307 | + { |
| 308 | + "match": "->", |
| 309 | + "name": "keyword.operator.nushell" |
| 310 | + } |
| 311 | + ] |
273 | 312 | }, |
274 | 313 | "function-inout": { |
275 | 314 | "begin": "(?<=]\\s*)(:)\\s+(\\[)", |
|
0 commit comments