Shopify / theme-check

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

[Intelligent code completion] Support collection retrieved via its name #677

Open Poitrin opened 1 year ago

Poitrin commented 1 year ago

Created by https://github.com/Shopify/theme-liquid-docs/issues/18

Describe the bug Intelligent Code Completion does not support collection retrieved via its name. Therefore, collections.first.products is supported, but collections['sale-potions'].products isn't.

Expected In the example …

{% for x in collections['sale-potions'].products %}
    {{- x.█

x should be treated as a product, so that suggestions for product (available, collections, compare_at_price, …) are displayed at the cursor's position.

Actual Wrong suggestions

x seems to be treated as a collection, so that suggestions for collection are displayed.