Add block parameter completion and hover - #1308
Merged
Merged
Conversation
charlespwd
commented
Sep 29, 2026
charlespwd
marked this pull request as ready for review
September 30, 2026 11:17
This reverts commit cf4e007.
charlespwd
force-pushed
the
block-parameter-language-features
branch
from
September 30, 2026 12:30
7721941 to
935c020
Compare
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
Teach the language server the same merged
blockcall interface as Theme Check. Completion and hover now resolve schema settings, LiquidDoc parameters, and built-incontentat the call site while preservingblock.settings.<id>inside the target block.Problem
Theme Check validates plain block arguments, but the editor could not discover or explain them. Authors had to inspect the target block, incomplete argument markup had no useful completion context, and schema translation keys could leak into editor documentation instead of showing their translated text.
Solution
At
{% block 'card', ... %}, completion resolves the target block on each request and offers one item per parameter. Its documentation presentsname (Optional): type, keeps the type code-formatted like other Liquid value hovers, and adds the LiquidDoc description plus the theme setting's translated label and info.Hover presents the same parameter documentation. Schema
t:keys are resolved through the default schema locale and unresolved keys are omitted.Inside
blocks/*.liquid, each schema setting ID also completes and hovers as a plain variable. The plain ID andblock.settings.<id>are aliases with the same schema-derived Liquid type. A same-named LiquidDoc parameter describes that variable without overriding its schema type.The completion parser recovers empty, partial, multiline, and unclosed argument slots. Tag completion uses the path relative to the theme root, so
blockis offered only intemplates/**/*.liquidand directlayout/*.liquidfiles. Nested block calls remain available in those files.This includes a patch changeset for
@shopify/theme-language-server-common.