Shopify / theme-check

The Ultimate Shopify Theme Linter
Other
338 stars 95 forks source link

[Intelligent code completion] Suggest object attributes when using `paginate` #687

Closed Poitrin closed 2 months ago

Poitrin commented 1 year ago

Describe the bug / Actual :+1: Global objects used with paginate are suggested … 14-17-z0lsv-zj9a3

:-1: … but attributes of a specific object are not suggested. 14-16-vhgwi-kl10p

Expected Attributes of specific objects (e.g. customer.orders) should be suggested too.

Debugging information

Additional context Liquid::Template.parse(markup) in VariableLookupFinder will raise an error, as it doesn't know paginate. This problem could be solved with TolerantParser::Template.parse(markup). However, the resulting tag is much "lighter" and might not contain all the relevant information.

In the screenshot, you see the debug output of paginate customer.orders vs. echo customer.orders. 14-53-2zsqy-ybr46

Outsourced from #683