Shopify / Shopify/theme-tools

`Unknown object` warnings for global Liquid objects in editor when using `{% doc %}` tag

Open
#944 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
TypeScript
Stars
234
Forks
92
Avg merge
1d 3h
Merged PRs (30d)
6

Description

Description:

When using the Liquid {% doc %} tag in a .liquid snippet, a warning is generated for global objects. For example the section object.

Warning: Unknown object ‘section’ used.

Steps to Reproduce:

  1. Use the {% doc %} tag syntax in a .liquid snippet file.
  2. Observe the warning message in Cursor / Visual Studio Code.

Expected Behavior:

The {% doc %} tag should not give warnings for global available liquid objects.

Actual Behavior:

A warning is shown for section, predictive_search and more.

Warning: Unknown object ‘section’ used.

Additional Context:

This may indicate that the {% doc %} tag does not correctly recognize global objects when used inside snippet files.

Image

I tried adding and passing the global object to the doc declaration and snippet, but that doesn’t solve the issue because the parameter name conflicts with a built-in Liquid tag. That error is good and makes sense.

The parameter 'section' shares the same name with a liquid tag.

Image

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

Reproduce the warning in a .liquid snippet containing a {% doc %} tag, using Cursor or Visual Studio Code, and compare handling of global objects such as section and predictive_search. Trace the editor warning path for doc-tag parameters and verify that valid global Liquid objects no longer produce unknown-object warnings while the documented name-conflict error remains.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.