Shopify / Shopify/theme-tools

[Intelligent code completion] Support collection retrieved via its name

Open
#404 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:theme-check enhancement
Dominant language
TypeScript
Stars
234
Forks
92
Avg merge
1d 3h
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the intelligent code-completion entry point that resolves collection access, then trace how bracketed collection names are handled in the provided Liquid example. Done means collections['sale-potions'].products infers x as a product and shows product suggestions at the cursor.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.