Add support for # inline comment tag#833
Merged
sebastienros merged 2 commits intomainfrom Oct 23, 2025
Merged
Conversation
Co-authored-by: sebastienros <1165805+sebastienros@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for # tag with unit tests
Add support for # inline comment tag
Oct 23, 2025
Contributor
|
These changes allow {% # this is a comment %}Remaining issue: Inside Example: {% liquid
assign name = 'John'
# very important information
assign name = 'Jenna'
echo name
%}Observed behavior:
Expected behavior: Lines starting with Goal: The example from the initial description: {% liquid
# required args:
assign product = product
# optional args:
assign should_show_border = should_show_border | default: true
assign should_show_cursor = should_show_cursor | default: true
%}@copilot can you take a look and prepare a PR to fix this problem? |
This was referenced Oct 27, 2025
This was referenced Nov 10, 2025
This was referenced Nov 17, 2025
This was referenced Nov 24, 2025
This was referenced Dec 1, 2025
This was referenced Feb 25, 2026
This was referenced Mar 16, 2026
This was referenced Mar 23, 2026
This was referenced Mar 30, 2026
This was referenced Apr 6, 2026
This was referenced Apr 13, 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.
This PR adds support for the
#inline comment tag, as introduced in Shopify's Liquid PR #1498. This provides a simpler syntax for adding single-line comments without requiring an end tag.New Syntax
{% # This is an inline comment %}The inline comment tag supports whitespace trimming like other Liquid tags:
{%- # trimmed comment -%}Examples
Basic usage:
Hello {% # this is a comment %} WorldOutput:
Hello WorldWith whitespace trimming:
Hello{%- # comment -%}WorldOutput:
HelloWorldIn templates:
{% # Start of section %} {% assign name = 'John' %} {% # Output the greeting %} Hello {{ name }}! {% # End of section %}Output:
Hello John!Between control structures:
{% if true %} {% # This comment won't appear in output %} Success {% endif %}Output:
SuccessImplementation Details
CommentStatementAST node for consistency#as a special character (not a valid identifier)echo,break, andcontinue-) markers like other Liquid tagsTesting
Added comprehensive test coverage:
Fixes the issue requesting support for the # comment tag as referenced in the Shopify Liquid enhancement.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/Shopify/liquid/pulls/1498curl -s REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #493
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.