Closed karreiro closed 2 years ago
Currently, AssignmentsFinder only visits Liquid::Assign nodes to get valid assignments. However, it must also support iterator assignments like:
AssignmentsFinder
Liquid::Assign
1. {% for p in collections.first.products %} 2. {% assign last_product = p %} 3. {{ p.title }} 4. {{ last_product.█ }} 5. {% endfor %}
In other words, AssignmentsFinder must know that p exists at the line 2 and its type is product (so, last_product is also a product).
p
product
last_product
Context/Motivation: https://github.com/Shopify/theme-check/pull/654#discussion_r1018299135
Currently,
AssignmentsFinder
only visitsLiquid::Assign
nodes to get valid assignments. However, it must also support iterator assignments like:In other words,
AssignmentsFinder
must know thatp
exists at the line 2 and its type isproduct
(so,last_product
is also aproduct
).Context/Motivation: https://github.com/Shopify/theme-check/pull/654#discussion_r1018299135