-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add #
inline comment tag.
#1498
Conversation
The only reason that PR had failing tests is because @tobi pushed ab45548 which is basically the scope creep that prevented an initial version from shipping that just supported |
4deaa31
to
05dc7d7
Compare
Very much like this feature, anything I can do to assist? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an entry to History.md for the change as well.
Other than that and my review comments, LGTM.
invalid_delimiter: "'%{tag}' is not a valid delimiter for %{block_name} tags. use %{block_delimiter}" | ||
render: "Syntax error in tag 'render' - Template name must be a quoted string" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, it is better to do this reordering/refactoring in a separate commit from the commit to add a feature.
This commit adds a new tag named `#` that behaves like a comment. Therefore it behaves as you'd expect any tag would work. The difference with the comment tag is that the comment is in the tag markup and that there is no block delimiter. What it looks like in practice: ```liquid {%- # this is an inline comment -%} {% # this too is an inline comment %} {% 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 %} {% liquid # This is a very long comment that spans multiple lines. # It looks very similar to what it would look like if you wrote # ruby code instead of liquid. But it doesn't have all the clunk # of having an open tag and a close tag with so many characters. %} ``` Co-authored-by: Dylan Thacker-Smith <Dylan.Smith@shopify.com>
b89bf9b
to
54414df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed commits to address my minor review suggestions. I've also merged the corresponding liquid-c PR and updated this PR to test against liquid-c master again.
🥳 |
The Mechanic community - https://apps.shopify.com/mechanic - is going to be puuuuumped about this. Been a requested feature for eons, and we've been holding off after seeing this in development. Thank you! |
Note that this has been deployed and is available to use in Shopify now, even though the documentation hasn't yet been updated to mention this feature. |
Will this work? If not, what's the best alternative?
|
@ADTC. No this is still best served by the Inline comments are for smaller comments and every line must be prefixed by |
This PR adds a new tag named
#
that behaves like a comment.Therefore it behaves as you'd expect any tag would work. The difference with the comment tag is that the comment is in the tag markup and that there is no block delimiter.
What it looks like in practice:
It's a follow up of #1401 (thanks @dylanahsmith !) with passing unit tests. Like #1401, this depends on a liquid-c PR from Dylan (that I rebased in inline-comment-fresh)