Skip to content

Add block parameter completion and hover - #1308

Merged
charlespwd merged 7 commits into
mainfrom
block-parameter-language-features
Sep 30, 2026
Merged

charlespwd merged 7 commits into
mainfrom
block-parameter-language-features

Conversation

@charlespwd

@charlespwd charlespwd commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

In this PR

Teach the language server the same merged block call interface as Theme Check. Completion and hover now resolve schema settings, LiquidDoc parameters, and built-in content at the call site while preserving block.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 presents name (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 and block.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 block is offered only in templates/**/*.liquid and direct layout/*.liquid files. Nested block calls remain available in those files.

This includes a patch changeset for @shopify/theme-language-server-common.

Comment thread packages/theme-language-server-common/src/utils/blockParameters.ts Outdated
@charlespwd
charlespwd marked this pull request as ready for review September 30, 2026 11:17
@charlespwd
charlespwd requested a review from a team as a code owner September 30, 2026 11:17
@charlespwd
charlespwd force-pushed the block-parameter-language-features branch from 7721941 to 935c020 Compare September 30, 2026 12:30
@charlespwd
charlespwd merged commit 2066abf into main Sep 30, 2026
8 checks passed
@charlespwd
charlespwd deleted the block-parameter-language-features branch September 30, 2026 13:49
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