Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Handle variable lookup as names in UnusedAssign #612

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

charlespwd
Copy link
Contributor

The {{ [some_var] }} syntax is valid Liquid. When this happens, the
tree gives us a Liquid::VariableLookup for the node.value.name (instead
of a string).

To handle those cases, we simply return node.value.name.name.

It's not entirely future proof, but fixing this in Shopify/liquid seemed non-trivial.

Fixes #576

The `{{ [some_var] }}` syntax is valid Liquid. When this happens, the
tree gives us a Liquid::VariableLookup for the node.value.name (instead
of a string).

To handle those cases, we simply return node.value.name.name.

It's not entirely future proof, but fixing this in Shopify/liquid seemed non-trivial.

Fixes #576
@charlespwd charlespwd requested a review from a team July 20, 2022 18:07
Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @charlespwd!

@charlespwd charlespwd merged commit 4b777c2 into main Jul 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic metafield keys throw Unidentified Objects error
3 participants