-
Notifications
You must be signed in to change notification settings - Fork 37
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
Improve alias parsing in the cst & ast #845
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Alok Swamy <alok.swamy@shopify.com>
8988b17
to
67f029f
Compare
67f029f
to
750a754
Compare
variable: ConcreteRenderVariableExpression | null; | ||
aliasExpression: ConcreteRenderAliasExpression | null; |
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.
can we keep this as-is?
@@ -388,6 +389,11 @@ export interface ConcreteRenderVariableExpression | |||
name: ConcreteLiquidExpression; | |||
} | |||
|
|||
export interface ConcreteRenderAliasExpression | |||
extends ConcreteBasicNode<ConcreteNodeTypes.RenderAliasExpression> { | |||
alias: 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.
If we keep alias
in ConcreteLiquidTagRenderMarkup
, we can make this .value
@@ -183,7 +183,7 @@ function printNamedLiquidBlockStart( | |||
case NamedTags.render: { | |||
const markup = node.markup; | |||
const trailingWhitespace = | |||
markup.args.length > 0 || (markup.variable && markup.alias) ? line : ' '; | |||
markup.args.length > 0 || (markup.variable && markup.aliasExpression?.alias) ? line : ' '; |
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.
Does this condition need to be updated?
When would markup.aliasExpression
be truthy
but markup.aliasExpression?.alias
be falsy
?
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.
Based off the types in stage-1
, I would expect aliasExpression
to be null
This is going in the right direction! Left some questions / comments :) |
What are you adding in this PR?
Closes: https://github.com/Shopify/developer-tools-team/issues/607
RenderAliasExpression
node type.as
andwith
part of render tagsBefore you deploy
changeset