Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
clauderic
force-pushed
the
liquiddoc-string-literal-unions
branch
from
September 29, 2026 20:31
b24a75f to
c038b0f
Compare
This branch has not been deployed
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.
What are you adding in this PR?
LiquidDoc
@paramtypes can now be string enums:{% doc %} @param {'heading' | 'small'} [variant] - Text style {% enddoc %}render(includingwith/foraliases),content_forandblockagainst the allowed values, and suggests each allowed value as a replacement. When adding a missing required argument torenderorcontent_for, it inserts the first allowed value. Dynamic values such as variables are not checked. Block parameters backed by a schema setting keep the setting's type, as in Validate block call parameters #1306.default, shows them in hovers and completion docs, and inserts the first one inrenderandcontent_forparameter completions.}inside a quoted string. If a quote is left open, the type still ends at the first}, as before.Enums are modeled as unions of string literal types rather than as a dedicated enum kind. Unions such as
{string | number}or{product | collection}and discriminated unions (#223) can therefore build on this without another change to the model. For now, only string literals parse as union members.The four commits are meant to be reviewed in order: parser fix, declarations, argument checks, language server.
What's next? Any followup issues?
{string | number}and{product | collection}: the parser has to accept type names as union members, and the checks and type system need rules for mixed unions.textorselectsetting is not enforced at call sites yet.Tophatting
In a snippet
snippets/text.liquidthat declares the@paramabove:{{ variant }}: it shows'heading' | 'small'.styleafter{% assign style = variant | default: 'heading' %}: it still shows'heading' | 'small'.{% render 'text', variant: 'body' %}is reported, with suggestions to replace'body'with'heading'or'small'.Before you deploy
changesetchangeset🤖 Generated with Claude Code