Shopify / theme-check

The Ultimate Shopify Theme Linter
Other
340 stars 96 forks source link

Introduce the `AssignmentsCompletionProvider` to suggest variables #667

Closed Poitrin closed 2 years ago

Poitrin commented 2 years ago

WHY are these changes introduced?

Fixes #659

WHAT is this pull request doing?

Introduce the AssignmentsCompletionProvider to suggest variables

How to test your changes?

  1. Make sure that you are on the correct theme-check branch.
  2. Test with Liquid code similar to this:
    {%- liquid
    assign product = all_products.first
    assign prod_uct = product
    %}
    {{ prod█ }}
  3. When you start typing prod, do you see the following suggestions? 23-32-pyhc4-r394p
  4. Does product only appear once? Do product and prod_uct display the correct description (namely the one about the globally available variable product)?

Add the following code below:

{%- liquid
  assign image1 = all_products.first.images.first
%}
{{ ima█ }}
  1. When you type ima, does it suggest image1?
  2. When you type ima in the first example (instead of prod), does it not suggest image1?