`Unknown object` warnings for global Liquid objects in editor when using `{% doc %}` tag
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:
- Use the
{% doc %}tag syntax in a.liquidsnippet file. - 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.
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.
Could this be prioritized? We're having a lot of pollution warnings due to this.
My workaround for now is using something like this @bakura10
{%- doc -%}
@description Example
@param {section} section_object
{%- enddoc -%}
{{ section_object }}
Same goes for "form" and "paginate"