Shopify / theme-check

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

[Intelligent code completion] `AssignmentsFinder` shouldn't index variables when it can't infer the proper type #655

Closed karreiro closed 1 year ago

karreiro commented 1 year ago

AssignmentsFinder shouldn't suggest attributes for target in the following scenario, because we can't guess the correct type:

{%- liquid
  if use_variant
    assign target = cart
  else
    assign target = product
  endif
%}
{{ target.█ }}

Relates: https://github.com/Shopify/theme-check/issues/663