Add implicit block content tooling - #1314
Merged
Merged
Conversation
charlespwd
marked this pull request as ready for review
September 30, 2026 15:27
clauderic
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this PR
Treat
contentas the always-available implicit string parameter inside theme block files.Problem
Block calls already receive built-in
contentfrom an explicit argument or inline body, but block files did not expose that contract consistently. Barecontentwas reported as undefined,block.contenthad no useful type information, and a schema setting could declarecontentwith an incompatible type without an error-severity check.Solution
Inside
blocks/*.liquid, the language server now types both barecontentandblock.contentasstring. 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-sideblockobjects are unchanged.Theme Check adds two recommended checks:
BlockContentUsagereports an error onblock.contentand directs authors to barecontent.ValidBlockContentSettingTypereports an error when a schema setting namedcontentmaps 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 callerblock.content:remains invalid.This follows #1308 and includes changesets for Theme Check Common, Theme Check Node, and Theme Language Server Common.