Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Poitrin opened this issue Dec 14, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Poitrin
Copy link
Contributor

Poitrin commented Dec 14, 2022

Describe the bug / Actual
πŸ‘ Global objects used with paginate are suggested …
14-17-z0lsv-zj9a3

πŸ‘Ž … 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

  • OS: macOS
  • Version: 1.12.0

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

@Poitrin Poitrin added the bug Something isn't working label Dec 14, 2022
Poitrin pushed a commit that referenced this issue Dec 14, 2022
### WHY are these changes introduced?

Fixes #683 

### WHAT is this pull request doing?

Treats `paginate` in a similar way as `echo`, so that suggestions are shown.

Use cases like `{% paginate customer.orders` will be treated in #687.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant