Skip to content

Add implicit block content tooling - #1314

Merged
charlespwd merged 2 commits into
mainfrom
block-content-implicit-argument
Sep 30, 2026
Merged

charlespwd merged 2 commits into
mainfrom
block-content-implicit-argument

Conversation

@charlespwd

@charlespwd charlespwd commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

In this PR

Treat content as the always-available implicit string parameter inside theme block files.

Problem

Block calls already receive built-in content from an explicit argument or inline body, but block files did not expose that contract consistently. Bare content was reported as undefined, block.content had no useful type information, and a schema setting could declare content with an incompatible type without an error-severity check.

Solution

Inside blocks/*.liquid, the language server now types both bare content and block.content as string. They receive the same completion and hover behavior, and later assignments can still change the bare variable's type from that point in the file. Section-side block objects are unchanged.

Theme Check adds two recommended checks:

  • BlockContentUsage reports an error on block.content and directs authors to bare content.
  • ValidBlockContentSettingType reports an error when a schema setting named content maps to a non-string Liquid type.

String-compatible schema settings and LiquidDoc requiredness continue to merge with the built-in parameter. Caller syntax is unchanged: plain content: remains valid and caller block.content: remains invalid.

This follows #1308 and includes changesets for Theme Check Common, Theme Check Node, and Theme Language Server Common.

@charlespwd
charlespwd marked this pull request as ready for review September 30, 2026 15:27
@charlespwd
charlespwd requested a review from a team as a code owner September 30, 2026 15:27
@charlespwd
charlespwd merged commit eef60ee into main Sep 30, 2026
8 checks passed
@charlespwd
charlespwd deleted the block-content-implicit-argument branch September 30, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants