| 1 |
{ |
| 2 |
"name": "liquid", |
| 3 |
"scopeName": "text.html.liquid", |
| 4 |
"fileTypes": ["liquid"], |
| 5 |
"foldingStartMarker": "(?x)\n{%\n -?\n \\s*\n (capture|case|comment|for|form|if|javascript|paginate|schema|style)\n [^(%})]+\n%}\n", |
| 6 |
"foldingStopMarker": "(?x)\n{%\n \\s*\n (endcapture|endcase|endcomment|endfor|endform|endif|endjavascript|endpaginate|endschema|endstyle)\n [^(%})]+\n%}\n", |
| 7 |
"injections": { |
| 8 |
"L:meta.embedded.block.js, L:meta.embedded.block.css, L:meta.embedded.block.html, L:string.quoted": { |
| 9 |
"patterns": [ |
| 10 |
{ |
| 11 |
"include": "#injection" |
| 12 |
} |
| 13 |
] |
| 14 |
} |
| 15 |
}, |
| 16 |
"patterns": [ |
| 17 |
{ |
| 18 |
"include": "#core" |
| 19 |
} |
| 20 |
], |
| 21 |
"repository": { |
| 22 |
"core": { |
| 23 |
"patterns": [ |
| 24 |
{ |
| 25 |
"include": "#raw_tag" |
| 26 |
}, |
| 27 |
{ |
| 28 |
"include": "#comment_block" |
| 29 |
}, |
| 30 |
{ |
| 31 |
"include": "#style_codefence" |
| 32 |
}, |
| 33 |
{ |
| 34 |
"include": "#stylesheet_codefence" |
| 35 |
}, |
| 36 |
{ |
| 37 |
"include": "#json_codefence" |
| 38 |
}, |
| 39 |
{ |
| 40 |
"include": "#javascript_codefence" |
| 41 |
}, |
| 42 |
{ |
| 43 |
"include": "#object" |
| 44 |
}, |
| 45 |
{ |
| 46 |
"include": "#tag" |
| 47 |
}, |
| 48 |
{ |
| 49 |
"include": "text.html.basic" |
| 50 |
} |
| 51 |
] |
| 52 |
}, |
| 53 |
"injection": { |
| 54 |
"patterns": [ |
| 55 |
{ |
| 56 |
"include": "#raw_tag" |
| 57 |
}, |
| 58 |
{ |
| 59 |
"include": "#comment_block" |
| 60 |
}, |
| 61 |
{ |
| 62 |
"include": "#object" |
| 63 |
}, |
| 64 |
{ |
| 65 |
"include": "#tag_injection" |
| 66 |
} |
| 67 |
] |
| 68 |
}, |
| 69 |
"raw_tag": { |
| 70 |
"begin": "{%-?\\s*(raw)\\s*-?%}", |
| 71 |
"end": "{%-?\\s*(endraw)\\s*-?%}", |
| 72 |
"beginCaptures": { |
| 73 |
"1": { |
| 74 |
"name": "entity.name.tag.liquid" |
| 75 |
} |
| 76 |
}, |
| 77 |
"endCaptures": { |
| 78 |
"1": { |
| 79 |
"name": "entity.name.tag.liquid" |
| 80 |
} |
| 81 |
}, |
| 82 |
"name": "meta.entity.tag.raw.liquid", |
| 83 |
"contentName": "string.unquoted.liquid", |
| 84 |
"patterns": [ |
| 85 |
{ |
| 86 |
"match": "(.(?!{%-?\\s*endraw\\s*-?%}))*." |
| 87 |
} |
| 88 |
] |
| 89 |
}, |
| 90 |
"comment_block": { |
| 91 |
"begin": "{%-?\\s*comment\\s*-?%}", |
| 92 |
"end": "{%-?\\s*endcomment\\s*-?%}", |
| 93 |
"name": "comment.block.liquid", |
| 94 |
"patterns": [ |
| 95 |
{ |
| 96 |
"include": "#comment_block" |
| 97 |
}, |
| 98 |
{ |
| 99 |
"match": "(.(?!{%-?\\s*(comment|endcomment)\\s*-?%}))*." |
| 100 |
} |
| 101 |
] |
| 102 |
}, |
| 103 |
"style_codefence": { |
| 104 |
"begin": "({%-?)\\s*(style)\\s*(-?%})", |
| 105 |
"end": "({%-?)\\s*(endstyle)\\s*(-?%})", |
| 106 |
"beginCaptures": { |
| 107 |
"0": { |
| 108 |
"name": "meta.tag.metadata.style.start.liquid" |
| 109 |
}, |
| 110 |
"1": { |
| 111 |
"name": "punctuation.definition.tag.begin.liquid" |
| 112 |
}, |
| 113 |
"2": { |
| 114 |
"name": "entity.name.tag.style.liquid" |
| 115 |
}, |
| 116 |
"3": { |
| 117 |
"name": "punctuation.definition.tag.begin.liquid" |
| 118 |
} |
| 119 |
}, |
| 120 |
"endCaptures": { |
| 121 |
"0": { |
| 122 |
"name": "meta.tag.metadata.style.end.liquid" |
| 123 |
}, |
| 124 |
"1": { |
| 125 |
"name": "punctuation.definition.tag.end.liquid" |
| 126 |
}, |
| 127 |
"2": { |
| 128 |
"name": "entity.name.tag.style.liquid" |
| 129 |
}, |
| 130 |
"3": { |
| 131 |
"name": "punctuation.definition.tag.end.liquid" |
| 132 |
} |
| 133 |
}, |
| 134 |
"name": "meta.block.style.liquid", |
| 135 |
"contentName": "meta.embedded.block.css", |
| 136 |
"patterns": [ |
| 137 |
{ |
| 138 |
"include": "source.css" |
| 139 |
} |
| 140 |
] |
| 141 |
}, |
| 142 |
"stylesheet_codefence": { |
| 143 |
"begin": "({%-?)\\s*(stylesheet)\\s*(-?%})", |
| 144 |
"end": "({%-?)\\s*(endstylesheet)\\s*(-?%})", |
| 145 |
"beginCaptures": { |
| 146 |
"0": { |
| 147 |
"name": "meta.tag.metadata.style.start.liquid" |
| 148 |
}, |
| 149 |
"1": { |
| 150 |
"name": "punctuation.definition.tag.begin.liquid" |
| 151 |
}, |
| 152 |
"2": { |
| 153 |
"name": "entity.name.tag.style.liquid" |
| 154 |
}, |
| 155 |
"3": { |
| 156 |
"name": "punctuation.definition.tag.begin.liquid" |
| 157 |
} |
| 158 |
}, |
| 159 |
"endCaptures": { |
| 160 |
"0": { |
| 161 |
"name": "meta.tag.metadata.style.end.liquid" |
| 162 |
}, |
| 163 |
"1": { |
| 164 |
"name": "punctuation.definition.tag.end.liquid" |
| 165 |
}, |
| 166 |
"2": { |
| 167 |
"name": "entity.name.tag.style.liquid" |
| 168 |
}, |
| 169 |
"3": { |
| 170 |
"name": "punctuation.definition.tag.end.liquid" |
| 171 |
} |
| 172 |
}, |
| 173 |
"name": "meta.block.style.liquid", |
| 174 |
"contentName": "meta.embedded.block.css", |
| 175 |
"patterns": [ |
| 176 |
{ |
| 177 |
"include": "source.css" |
| 178 |
} |
| 179 |
] |
| 180 |
}, |
| 181 |
"json_codefence": { |
| 182 |
"begin": "({%-?)\\s*(schema)\\s*(-?%})", |
| 183 |
"end": "({%-?)\\s*(endschema)\\s*(-?%})", |
| 184 |
"beginCaptures": { |
| 185 |
"0": { |
| 186 |
"name": "meta.tag.metadata.schema.start.liquid" |
| 187 |
}, |
| 188 |
"1": { |
| 189 |
"name": "punctuation.definition.tag.begin.liquid" |
| 190 |
}, |
| 191 |
"2": { |
| 192 |
"name": "entity.name.tag.schema.liquid" |
| 193 |
}, |
| 194 |
"3": { |
| 195 |
"name": "punctuation.definition.tag.begin.liquid" |
| 196 |
} |
| 197 |
}, |
| 198 |
"endCaptures": { |
| 199 |
"0": { |
| 200 |
"name": "meta.tag.metadata.schema.end.liquid" |
| 201 |
}, |
| 202 |
"1": { |
| 203 |
"name": "punctuation.definition.tag.end.liquid" |
| 204 |
}, |
| 205 |
"2": { |
| 206 |
"name": "entity.name.tag.schema.liquid" |
| 207 |
}, |
| 208 |
"3": { |
| 209 |
"name": "punctuation.definition.tag.end.liquid" |
| 210 |
} |
| 211 |
}, |
| 212 |
"name": "meta.block.schema.liquid", |
| 213 |
"contentName": "meta.embedded.block.json", |
| 214 |
"patterns": [ |
| 215 |
{ |
| 216 |
"include": "source.json" |
| 217 |
} |
| 218 |
] |
| 219 |
}, |
| 220 |
"javascript_codefence": { |
| 221 |
"begin": "({%-?)\\s*(javascript)\\s*(-?%})", |
| 222 |
"end": "({%-?)\\s*(endjavascript)\\s*(-?%})", |
| 223 |
"beginCaptures": { |
| 224 |
"0": { |
| 225 |
"name": "meta.tag.metadata.javascript.start.liquid" |
| 226 |
}, |
| 227 |
"1": { |
| 228 |
"name": "punctuation.definition.tag.begin.liquid" |
| 229 |
}, |
| 230 |
"2": { |
| 231 |
"name": "entity.name.tag.javascript.liquid" |
| 232 |
}, |
| 233 |
"3": { |
| 234 |
"name": "punctuation.definition.tag.begin.liquid" |
| 235 |
} |
| 236 |
}, |
| 237 |
"endCaptures": { |
| 238 |
"0": { |
| 239 |
"name": "meta.tag.metadata.javascript.end.liquid" |
| 240 |
}, |
| 241 |
"1": { |
| 242 |
"name": "punctuation.definition.tag.end.liquid" |
| 243 |
}, |
| 244 |
"2": { |
| 245 |
"name": "entity.name.tag.javascript.liquid" |
| 246 |
}, |
| 247 |
"3": { |
| 248 |
"name": "punctuation.definition.tag.end.liquid" |
| 249 |
} |
| 250 |
}, |
| 251 |
"name": "meta.block.javascript.liquid", |
| 252 |
"contentName": "meta.embedded.block.js", |
| 253 |
"patterns": [ |
| 254 |
{ |
| 255 |
"include": "source.js" |
| 256 |
} |
| 257 |
] |
| 258 |
}, |
| 259 |
"tag": { |
| 260 |
"begin": "(?<!comment %})(?<!comment -%})(?<!comment%})(?<!comment-%})(?<!raw %})(?<!raw -%})(?<!raw%})(?<!raw-%}){%-?", |
| 261 |
"end": "-?%}", |
| 262 |
"name": "meta.tag.liquid", |
| 263 |
"beginCaptures": { |
| 264 |
"0": { |
| 265 |
"name": "punctuation.definition.tag.begin.liquid" |
| 266 |
} |
| 267 |
}, |
| 268 |
"endCaptures": { |
| 269 |
"0": { |
| 270 |
"name": "punctuation.definition.tag.end.liquid" |
| 271 |
} |
| 272 |
}, |
| 273 |
"patterns": [ |
| 274 |
{ |
| 275 |
"include": "#tag_body" |
| 276 |
} |
| 277 |
] |
| 278 |
}, |
| 279 |
"tag_injection": { |
| 280 |
"begin": "(?<!comment %})(?<!comment -%})(?<!comment%})(?<!comment-%})(?<!raw %})(?<!raw -%})(?<!raw%})(?<!raw-%}){%-?(?!-?\\s*(endstyle|endjavascript|endcomment|endraw))", |
| 281 |
"end": "-?%}", |
| 282 |
"name": "meta.tag.liquid", |
| 283 |
"beginCaptures": { |
| 284 |
"0": { |
| 285 |
"name": "punctuation.definition.tag.end.liquid" |
| 286 |
} |
| 287 |
}, |
| 288 |
"endCaptures": { |
| 289 |
"0": { |
| 290 |
"name": "punctuation.definition.tag.end.liquid" |
| 291 |
} |
| 292 |
}, |
| 293 |
"patterns": [ |
| 294 |
{ |
| 295 |
"include": "#tag_body" |
| 296 |
} |
| 297 |
] |
| 298 |
}, |
| 299 |
"tag_body": { |
| 300 |
"patterns": [ |
| 301 |
{ |
| 302 |
"include": "#tag_liquid" |
| 303 |
}, |
| 304 |
{ |
| 305 |
"include": "#tag_assign" |
| 306 |
}, |
| 307 |
{ |
| 308 |
"include": "#tag_comment_inline" |
| 309 |
}, |
| 310 |
{ |
| 311 |
"include": "#tag_case" |
| 312 |
}, |
| 313 |
{ |
| 314 |
"include": "#tag_conditional" |
| 315 |
}, |
| 316 |
{ |
| 317 |
"include": "#tag_for" |
| 318 |
}, |
| 319 |
{ |
| 320 |
"include": "#tag_paginate" |
| 321 |
}, |
| 322 |
{ |
| 323 |
"include": "#tag_render" |
| 324 |
}, |
| 325 |
{ |
| 326 |
"include": "#tag_tablerow" |
| 327 |
}, |
| 328 |
{ |
| 329 |
"include": "#tag_expression" |
| 330 |
} |
| 331 |
] |
| 332 |
}, |
| 333 |
"tag_liquid": { |
| 334 |
"name": "meta.entity.tag.liquid.liquid", |
| 335 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(liquid)\\b", |
| 336 |
"beginCaptures": { |
| 337 |
"1": { |
| 338 |
"name": "keyword.control.liquid.liquid" |
| 339 |
} |
| 340 |
}, |
| 341 |
"end": "(?=%})", |
| 342 |
"patterns": [ |
| 343 |
{ |
| 344 |
"include": "#tag_comment_block_liquid" |
| 345 |
}, |
| 346 |
{ |
| 347 |
"include": "#tag_comment_inline_liquid" |
| 348 |
}, |
| 349 |
{ |
| 350 |
"include": "#tag_assign_liquid" |
| 351 |
}, |
| 352 |
{ |
| 353 |
"include": "#tag_case_liquid" |
| 354 |
}, |
| 355 |
{ |
| 356 |
"include": "#tag_conditional_liquid" |
| 357 |
}, |
| 358 |
{ |
| 359 |
"include": "#tag_for_liquid" |
| 360 |
}, |
| 361 |
{ |
| 362 |
"include": "#tag_paginate_liquid" |
| 363 |
}, |
| 364 |
{ |
| 365 |
"include": "#tag_render_liquid" |
| 366 |
}, |
| 367 |
{ |
| 368 |
"include": "#tag_tablerow_liquid" |
| 369 |
}, |
| 370 |
{ |
| 371 |
"include": "#tag_expression_liquid" |
| 372 |
} |
| 373 |
] |
| 374 |
}, |
| 375 |
"tag_comment_block_liquid": { |
| 376 |
"name": "comment.block.liquid", |
| 377 |
"begin": "(?:^\\s*)(comment)\\b", |
| 378 |
"end": "(?:^\\s*)(endcomment)\\b", |
| 379 |
"patterns": [ |
| 380 |
{ |
| 381 |
"include": "#tag_comment_block_liquid" |
| 382 |
}, |
| 383 |
{ |
| 384 |
"match": "(?:^\\s*)(?!(comment|endcomment)).*" |
| 385 |
} |
| 386 |
] |
| 387 |
}, |
| 388 |
"tag_comment_inline": { |
| 389 |
"name": "comment.line.number-sign.liquid", |
| 390 |
"begin": "#", |
| 391 |
"end": "(?=%})" |
| 392 |
}, |
| 393 |
"tag_comment_inline_liquid": { |
| 394 |
"name": "comment.line.number-sign.liquid", |
| 395 |
"begin": "(?:^\\s*)#.*", |
| 396 |
"end": "$" |
| 397 |
}, |
| 398 |
"tag_tablerow": { |
| 399 |
"name": "meta.entity.tag.tablerow.liquid", |
| 400 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(tablerow)\\b", |
| 401 |
"beginCaptures": { |
| 402 |
"1": { |
| 403 |
"name": "keyword.control.tablerow.liquid" |
| 404 |
} |
| 405 |
}, |
| 406 |
"end": "(?=%})", |
| 407 |
"patterns": [ |
| 408 |
{ |
| 409 |
"include": "#tag_tablerow_body" |
| 410 |
} |
| 411 |
] |
| 412 |
}, |
| 413 |
"tag_tablerow_liquid": { |
| 414 |
"name": "meta.entity.tag.tablerow.liquid", |
| 415 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(tablerow)\\b", |
| 416 |
"beginCaptures": { |
| 417 |
"1": { |
| 418 |
"name": "keyword.control.tablerow.liquid" |
| 419 |
} |
| 420 |
}, |
| 421 |
"end": "$", |
| 422 |
"patterns": [ |
| 423 |
{ |
| 424 |
"include": "#tag_tablerow_body" |
| 425 |
} |
| 426 |
] |
| 427 |
}, |
| 428 |
"tag_tablerow_body": { |
| 429 |
"patterns": [ |
| 430 |
{ |
| 431 |
"match": "\\b(in)\\b", |
| 432 |
"name": "keyword.control.liquid" |
| 433 |
}, |
| 434 |
{ |
| 435 |
"match": "\\b(cols|offset|limit):", |
| 436 |
"name": "keyword.control.liquid" |
| 437 |
}, |
| 438 |
{ |
| 439 |
"include": "#value_expression" |
| 440 |
} |
| 441 |
] |
| 442 |
}, |
| 443 |
"tag_for": { |
| 444 |
"name": "meta.entity.tag.for.liquid", |
| 445 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(for)\\b", |
| 446 |
"beginCaptures": { |
| 447 |
"1": { |
| 448 |
"name": "keyword.control.for.liquid" |
| 449 |
} |
| 450 |
}, |
| 451 |
"end": "(?=%})", |
| 452 |
"patterns": [ |
| 453 |
{ |
| 454 |
"include": "#tag_for_body" |
| 455 |
} |
| 456 |
] |
| 457 |
}, |
| 458 |
"tag_for_liquid": { |
| 459 |
"name": "meta.entity.tag.for.liquid", |
| 460 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(for)\\b", |
| 461 |
"beginCaptures": { |
| 462 |
"1": { |
| 463 |
"name": "keyword.control.for.liquid" |
| 464 |
} |
| 465 |
}, |
| 466 |
"end": "$", |
| 467 |
"patterns": [ |
| 468 |
{ |
| 469 |
"include": "#tag_for_body" |
| 470 |
} |
| 471 |
] |
| 472 |
}, |
| 473 |
"tag_for_body": { |
| 474 |
"patterns": [ |
| 475 |
{ |
| 476 |
"match": "\\b(in|reversed)\\b", |
| 477 |
"name": "keyword.control.liquid" |
| 478 |
}, |
| 479 |
{ |
| 480 |
"match": "\\b(offset|limit):", |
| 481 |
"name": "keyword.control.liquid" |
| 482 |
}, |
| 483 |
{ |
| 484 |
"include": "#value_expression" |
| 485 |
} |
| 486 |
] |
| 487 |
}, |
| 488 |
"tag_assign": { |
| 489 |
"name": "meta.entity.tag.liquid", |
| 490 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(assign|echo)\\b", |
| 491 |
"beginCaptures": { |
| 492 |
"1": { |
| 493 |
"name": "entity.name.tag.liquid" |
| 494 |
} |
| 495 |
}, |
| 496 |
"end": "(?=%})", |
| 497 |
"patterns": [ |
| 498 |
{ |
| 499 |
"include": "#filter" |
| 500 |
}, |
| 501 |
{ |
| 502 |
"include": "#attribute" |
| 503 |
}, |
| 504 |
{ |
| 505 |
"include": "#value_expression" |
| 506 |
} |
| 507 |
] |
| 508 |
}, |
| 509 |
"tag_assign_liquid": { |
| 510 |
"name": "meta.entity.tag.liquid", |
| 511 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(assign|echo)\\b", |
| 512 |
"beginCaptures": { |
| 513 |
"1": { |
| 514 |
"name": "entity.name.tag.liquid" |
| 515 |
} |
| 516 |
}, |
| 517 |
"end": "$", |
| 518 |
"patterns": [ |
| 519 |
{ |
| 520 |
"include": "#filter" |
| 521 |
}, |
| 522 |
{ |
| 523 |
"include": "#attribute_liquid" |
| 524 |
}, |
| 525 |
{ |
| 526 |
"include": "#value_expression" |
| 527 |
} |
| 528 |
] |
| 529 |
}, |
| 530 |
"tag_render": { |
| 531 |
"name": "meta.entity.tag.render.liquid", |
| 532 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(render)\\b", |
| 533 |
"beginCaptures": { |
| 534 |
"1": { |
| 535 |
"name": "entity.name.tag.render.liquid" |
| 536 |
} |
| 537 |
}, |
| 538 |
"end": "(?=%})", |
| 539 |
"patterns": [ |
| 540 |
{ |
| 541 |
"include": "#tag_render_special_keywords" |
| 542 |
}, |
| 543 |
{ |
| 544 |
"include": "#attribute" |
| 545 |
}, |
| 546 |
{ |
| 547 |
"include": "#value_expression" |
| 548 |
} |
| 549 |
] |
| 550 |
}, |
| 551 |
"tag_render_liquid": { |
| 552 |
"name": "meta.entity.tag.render.liquid", |
| 553 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(render)\\b", |
| 554 |
"beginCaptures": { |
| 555 |
"1": { |
| 556 |
"name": "entity.name.tag.render.liquid" |
| 557 |
} |
| 558 |
}, |
| 559 |
"end": "$", |
| 560 |
"patterns": [ |
| 561 |
{ |
| 562 |
"include": "#tag_render_special_keywords" |
| 563 |
}, |
| 564 |
{ |
| 565 |
"include": "#attribute_liquid" |
| 566 |
}, |
| 567 |
{ |
| 568 |
"include": "#value_expression" |
| 569 |
} |
| 570 |
] |
| 571 |
}, |
| 572 |
"tag_render_special_keywords": { |
| 573 |
"match": "\\b(with|as|for)\\b", |
| 574 |
"name": "keyword.control.other.liquid" |
| 575 |
}, |
| 576 |
"tag_paginate": { |
| 577 |
"name": "meta.entity.tag.paginate.liquid", |
| 578 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(paginate)\\b", |
| 579 |
"beginCaptures": { |
| 580 |
"1": { |
| 581 |
"name": "keyword.control.paginate.liquid" |
| 582 |
} |
| 583 |
}, |
| 584 |
"end": "(?=%})", |
| 585 |
"patterns": [ |
| 586 |
{ |
| 587 |
"include": "#tag_paginate_body" |
| 588 |
} |
| 589 |
] |
| 590 |
}, |
| 591 |
"tag_paginate_liquid": { |
| 592 |
"name": "meta.entity.tag.paginate.liquid", |
| 593 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(paginate)\\b", |
| 594 |
"beginCaptures": { |
| 595 |
"1": { |
| 596 |
"name": "keyword.control.paginate.liquid" |
| 597 |
} |
| 598 |
}, |
| 599 |
"end": "$", |
| 600 |
"patterns": [ |
| 601 |
{ |
| 602 |
"include": "#tag_paginate_body" |
| 603 |
} |
| 604 |
] |
| 605 |
}, |
| 606 |
"tag_paginate_body": { |
| 607 |
"patterns": [ |
| 608 |
{ |
| 609 |
"match": "\\b(by)\\b", |
| 610 |
"name": "keyword.control.liquid" |
| 611 |
}, |
| 612 |
{ |
| 613 |
"include": "#value_expression" |
| 614 |
} |
| 615 |
] |
| 616 |
}, |
| 617 |
"tag_conditional": { |
| 618 |
"name": "meta.entity.tag.conditional.liquid", |
| 619 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(if|elsif|unless)\\b", |
| 620 |
"beginCaptures": { |
| 621 |
"1": { |
| 622 |
"name": "keyword.control.conditional.liquid" |
| 623 |
} |
| 624 |
}, |
| 625 |
"end": "(?=%})", |
| 626 |
"patterns": [ |
| 627 |
{ |
| 628 |
"include": "#value_expression" |
| 629 |
} |
| 630 |
] |
| 631 |
}, |
| 632 |
"tag_conditional_liquid": { |
| 633 |
"name": "meta.entity.tag.conditional.liquid", |
| 634 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(if|elsif|unless)\\b", |
| 635 |
"beginCaptures": { |
| 636 |
"1": { |
| 637 |
"name": "keyword.control.conditional.liquid" |
| 638 |
} |
| 639 |
}, |
| 640 |
"end": "$", |
| 641 |
"patterns": [ |
| 642 |
{ |
| 643 |
"include": "#value_expression" |
| 644 |
} |
| 645 |
] |
| 646 |
}, |
| 647 |
"tag_case": { |
| 648 |
"name": "meta.entity.tag.case.liquid", |
| 649 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(case|when)\\b", |
| 650 |
"beginCaptures": { |
| 651 |
"1": { |
| 652 |
"name": "keyword.control.case.liquid" |
| 653 |
} |
| 654 |
}, |
| 655 |
"end": "(?=%})", |
| 656 |
"patterns": [ |
| 657 |
{ |
| 658 |
"include": "#value_expression" |
| 659 |
} |
| 660 |
] |
| 661 |
}, |
| 662 |
"tag_case_liquid": { |
| 663 |
"name": "meta.entity.tag.case.liquid", |
| 664 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(case|when)\\b", |
| 665 |
"beginCaptures": { |
| 666 |
"1": { |
| 667 |
"name": "keyword.control.case.liquid" |
| 668 |
} |
| 669 |
}, |
| 670 |
"end": "$", |
| 671 |
"patterns": [ |
| 672 |
{ |
| 673 |
"include": "#value_expression" |
| 674 |
} |
| 675 |
] |
| 676 |
}, |
| 677 |
"tag_expression_without_arguments": { |
| 678 |
"patterns": [ |
| 679 |
{ |
| 680 |
"match": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(endunless|endif)\\b", |
| 681 |
"captures": { |
| 682 |
"1": { |
| 683 |
"name": "keyword.control.conditional.liquid" |
| 684 |
} |
| 685 |
} |
| 686 |
}, |
| 687 |
{ |
| 688 |
"match": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(endfor|endtablerow|endpaginate)\\b", |
| 689 |
"captures": { |
| 690 |
"1": { |
| 691 |
"name": "keyword.control.loop.liquid" |
| 692 |
} |
| 693 |
} |
| 694 |
}, |
| 695 |
{ |
| 696 |
"match": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(endcase)\\b", |
| 697 |
"captures": { |
| 698 |
"1": { |
| 699 |
"name": "keyword.control.case.liquid" |
| 700 |
} |
| 701 |
} |
| 702 |
}, |
| 703 |
{ |
| 704 |
"match": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(capture|case|comment|for|form|if|javascript|paginate|schema|style)\\b", |
| 705 |
"captures": { |
| 706 |
"1": { |
| 707 |
"name": "keyword.control.other.liquid" |
| 708 |
} |
| 709 |
} |
| 710 |
}, |
| 711 |
{ |
| 712 |
"match": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(endcapture|endcase|endcomment|endfor|endform|endif|endjavascript|endpaginate|endschema|endstyle)\\b", |
| 713 |
"captures": { |
| 714 |
"1": { |
| 715 |
"name": "keyword.control.other.liquid" |
| 716 |
} |
| 717 |
} |
| 718 |
}, |
| 719 |
{ |
| 720 |
"match": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(else|break|continue)\\b", |
| 721 |
"captures": { |
| 722 |
"1": { |
| 723 |
"name": "keyword.control.other.liquid" |
| 724 |
} |
| 725 |
} |
| 726 |
} |
| 727 |
] |
| 728 |
}, |
| 729 |
"tag_expression": { |
| 730 |
"patterns": [ |
| 731 |
{ |
| 732 |
"include": "#tag_expression_without_arguments" |
| 733 |
}, |
| 734 |
{ |
| 735 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(\\w+)", |
| 736 |
"beginCaptures": { |
| 737 |
"1": { |
| 738 |
"name": "entity.name.tag.liquid" |
| 739 |
} |
| 740 |
}, |
| 741 |
"end": "(?=%})", |
| 742 |
"name": "meta.entity.tag.liquid", |
| 743 |
"patterns": [ |
| 744 |
{ |
| 745 |
"include": "#value_expression" |
| 746 |
} |
| 747 |
] |
| 748 |
} |
| 749 |
] |
| 750 |
}, |
| 751 |
"tag_expression_liquid": { |
| 752 |
"patterns": [ |
| 753 |
{ |
| 754 |
"include": "#tag_expression_without_arguments" |
| 755 |
}, |
| 756 |
{ |
| 757 |
"begin": "(?:(?:(?<={%)|(?<={%-)|^)\\s*)(\\w+)", |
| 758 |
"beginCaptures": { |
| 759 |
"1": { |
| 760 |
"name": "entity.name.tag.liquid" |
| 761 |
} |
| 762 |
}, |
| 763 |
"end": "$", |
| 764 |
"name": "meta.entity.tag.liquid", |
| 765 |
"patterns": [ |
| 766 |
{ |
| 767 |
"include": "#value_expression" |
| 768 |
} |
| 769 |
] |
| 770 |
} |
| 771 |
] |
| 772 |
}, |
| 773 |
"object": { |
| 774 |
"begin": "(?<!comment %})(?<!comment -%})(?<!comment%})(?<!comment-%})(?<!raw %})(?<!raw -%})(?<!raw%})(?<!raw-%}){{-?", |
| 775 |
"end": "-?}}", |
| 776 |
"name": "meta.object.liquid", |
| 777 |
"beginCaptures": { |
| 778 |
"0": { |
| 779 |
"name": "punctuation.definition.tag.begin.liquid" |
| 780 |
} |
| 781 |
}, |
| 782 |
"endCaptures": { |
| 783 |
"0": { |
| 784 |
"name": "punctuation.definition.tag.end.liquid" |
| 785 |
} |
| 786 |
}, |
| 787 |
"patterns": [ |
| 788 |
{ |
| 789 |
"include": "#filter" |
| 790 |
}, |
| 791 |
{ |
| 792 |
"include": "#attribute" |
| 793 |
}, |
| 794 |
{ |
| 795 |
"include": "#value_expression" |
| 796 |
} |
| 797 |
] |
| 798 |
}, |
| 799 |
"invalid_range": { |
| 800 |
"match": "\\((.(?!\\.\\.))+\\)", |
| 801 |
"name": "invalid.illegal.range.liquid" |
| 802 |
}, |
| 803 |
"range": { |
| 804 |
"begin": "\\(", |
| 805 |
"end": "\\)", |
| 806 |
"name": "meta.range.liquid", |
| 807 |
"beginCaptures": { |
| 808 |
"0": { |
| 809 |
"name": "punctuation.section.parens.begin.liquid" |
| 810 |
} |
| 811 |
}, |
| 812 |
"endCaptures": { |
| 813 |
"0": { |
| 814 |
"name": "punctuation.section.parens.end.liquid" |
| 815 |
} |
| 816 |
}, |
| 817 |
"patterns": [ |
| 818 |
{ |
| 819 |
"match": "\\.\\.", |
| 820 |
"name": "punctuation.range.liquid" |
| 821 |
}, |
| 822 |
{ |
| 823 |
"include": "#variable_lookup" |
| 824 |
}, |
| 825 |
{ |
| 826 |
"include": "#number" |
| 827 |
} |
| 828 |
] |
| 829 |
}, |
| 830 |
"number": { |
| 831 |
"match": "((-|\\+)\\s*)?[0-9]+(\\.[0-9]+)?", |
| 832 |
"name": "constant.numeric.liquid" |
| 833 |
}, |
| 834 |
"string": { |
| 835 |
"patterns": [ |
| 836 |
{ |
| 837 |
"include": "#string_single" |
| 838 |
}, |
| 839 |
{ |
| 840 |
"include": "#string_double" |
| 841 |
} |
| 842 |
] |
| 843 |
}, |
| 844 |
"string_double": { |
| 845 |
"begin": "\"", |
| 846 |
"end": "\"", |
| 847 |
"name": "string.quoted.double.liquid" |
| 848 |
}, |
| 849 |
"string_single": { |
| 850 |
"begin": "'", |
| 851 |
"end": "'", |
| 852 |
"name": "string.quoted.single.liquid" |
| 853 |
}, |
| 854 |
"operator": { |
| 855 |
"match": "(?:(?<=\\s)|\\b)(\\=\\=|!\\=|\\>|\\<|\\>\\=|\\<\\=|or|and|contains)(?:(?=\\s)|\\b)", |
| 856 |
"captures": { |
| 857 |
"1": { |
| 858 |
"name": "keyword.operator.expression.liquid" |
| 859 |
} |
| 860 |
} |
| 861 |
}, |
| 862 |
"language_constant": { |
| 863 |
"match": "\\b(false|true|nil|blank)\\b|empty(?!\\?)", |
| 864 |
"name": "constant.language.liquid" |
| 865 |
}, |
| 866 |
"attribute": { |
| 867 |
"begin": "\\w+:", |
| 868 |
"end": "(?=,|%}|}}|\\|)", |
| 869 |
"beginCaptures": { |
| 870 |
"0": { |
| 871 |
"name": "entity.other.attribute-name.liquid" |
| 872 |
} |
| 873 |
}, |
| 874 |
"patterns": [ |
| 875 |
{ |
| 876 |
"include": "#value_expression" |
| 877 |
} |
| 878 |
] |
| 879 |
}, |
| 880 |
"attribute_liquid": { |
| 881 |
"begin": "\\w+:", |
| 882 |
"end": "(?=,|\\|)|$", |
| 883 |
"beginCaptures": { |
| 884 |
"0": { |
| 885 |
"name": "entity.other.attribute-name.liquid" |
| 886 |
} |
| 887 |
}, |
| 888 |
"patterns": [ |
| 889 |
{ |
| 890 |
"include": "#value_expression" |
| 891 |
} |
| 892 |
] |
| 893 |
}, |
| 894 |
"filter": { |
| 895 |
"match": "\\|\\s*((?![\\.0-9])[a-zA-Z0-9_-]+\\:?)\\s*", |
| 896 |
"captures": { |
| 897 |
"1": { |
| 898 |
"name": "support.function.liquid" |
| 899 |
} |
| 900 |
} |
| 901 |
}, |
| 902 |
"value_expression": { |
| 903 |
"patterns": [ |
| 904 |
{ |
| 905 |
"match": "(\\[)(\\|)(?=[^\\]]*)(?=\\])", |
| 906 |
"captures": { |
| 907 |
"2": { |
| 908 |
"name": "invalid.illegal.filter.liquid" |
| 909 |
}, |
| 910 |
"3": { |
| 911 |
"name": "invalid.illegal.filter.liquid" |
| 912 |
} |
| 913 |
} |
| 914 |
}, |
| 915 |
{ |
| 916 |
"match": "(?<=\\s)(\\+|\\-|\\/|\\*)(?=\\s)", |
| 917 |
"name": "invalid.illegal.filter.liquid" |
| 918 |
}, |
| 919 |
{ |
| 920 |
"include": "#language_constant" |
| 921 |
}, |
| 922 |
{ |
| 923 |
"include": "#operator" |
| 924 |
}, |
| 925 |
{ |
| 926 |
"include": "#invalid_range" |
| 927 |
}, |
| 928 |
{ |
| 929 |
"include": "#range" |
| 930 |
}, |
| 931 |
{ |
| 932 |
"include": "#number" |
| 933 |
}, |
| 934 |
{ |
| 935 |
"include": "#string" |
| 936 |
}, |
| 937 |
{ |
| 938 |
"include": "#variable_lookup" |
| 939 |
} |
| 940 |
] |
| 941 |
}, |
| 942 |
"variable_lookup": { |
| 943 |
"patterns": [ |
| 944 |
{ |
| 945 |
"match": "\\b(additional_checkout_buttons|address|all_country_option_tags|all_products|article|articles|block|blog|blogs|canonical_url|cart|checkout|collection|collections|comment|content_for_additional_checkout_buttons|content_for_header|content_for_index|content_for_layout|country_option_tags|currency|current_page|current_tags|customer|customer_address|discount_allocation|discount_application|external_video|font|forloop|form|fulfillment|gift_card|handle|image|images|line_item|link|linklist|linklists|location|localization|metafield|model|model_source|order|page|page_description|page_image|page_title|pages|paginate|part|policy|powered_by_link|predictive_search|product|product_option|product_variant|recommendations|request|routes|script|scripts|search|section|selling_plan|selling_plan_allocation|selling_plan_group|settings|shipping_method|shop|shop_locale|store_availability|tablerow|tax_line|template|theme|transaction|unit_price_measurement|variant|video|video_source)\\b", |
| 946 |
"name": "variable.language.liquid" |
| 947 |
}, |
| 948 |
{ |
| 949 |
"match": "((?<=\\w\\:\\s)\\w+)", |
| 950 |
"name": "variable.parameter.liquid" |
| 951 |
}, |
| 952 |
{ |
| 953 |
"begin": "(?<=\\w)\\[", |
| 954 |
"beginCaptures": { |
| 955 |
"0": { |
| 956 |
"name": "punctuation.section.brackets.begin.liquid" |
| 957 |
} |
| 958 |
}, |
| 959 |
"end": "\\]", |
| 960 |
"endCaptures": { |
| 961 |
"0": { |
| 962 |
"name": "punctuation.section.brackets.end.liquid" |
| 963 |
} |
| 964 |
}, |
| 965 |
"name": "meta.brackets.liquid", |
| 966 |
"patterns": [ |
| 967 |
{ |
| 968 |
"include": "#string" |
| 969 |
} |
| 970 |
] |
| 971 |
}, |
| 972 |
{ |
| 973 |
"match": "(?<=(\\w|\\])\\.)([-\\w]+\\??)", |
| 974 |
"name": "variable.other.member.liquid" |
| 975 |
}, |
| 976 |
{ |
| 977 |
"match": "(?<=\\w)\\.(?=\\w)", |
| 978 |
"name": "punctuation.accessor.liquid" |
| 979 |
}, |
| 980 |
{ |
| 981 |
"match": "(?i)[a-z_](\\w|(?:-(?!\\}\\})))*", |
| 982 |
"name": "variable.other.liquid" |
| 983 |
} |
| 984 |
] |
| 985 |
} |
| 986 |
} |
| 987 |
} |
| 988 |
|