-
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
Rename doc param or its usage #811
Conversation
packages/theme-language-server-common/src/rename/providers/LiquidVariableRenameProvider.spec.ts
Show resolved
Hide resolved
(!!parentNode && | ||
parentNode.type === NodeTypes.LiquidDocParamNode && | ||
// We can only rename param tag's name; not its type or description | ||
parentNode.paramName === node && | ||
node.type === NodeTypes.TextNode) |
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 clarity purposes, I feel like this should be in a variable or its own function. WDYT?
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 received this comment a couple times, but can you clarify what you mean by this?
It's already in a pretty concise function. Do you want me to separate this into another one?
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.
It's more of a personal preference, so I won't be hurt if you choose to go in a different direction!
I think separating this into another function or a variable such as const isLiquidDocParamNameNode
would make it easier to reason about as someone not familiar with this code.
That would also allow us to only read from ancestors
when needed.
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.
Some non-blocking comments. Tophat and edge cases LGTM!
This one adds a really great feeling to the DX :)
5f63055
to
fbf6b17
Compare
fbf6b17
to
afebc66
Compare
What are you adding in this PR?
Closes #810
NOTE: if you have a
assign
(or equivalent) that collides with theparam
tag in doc, assume they are referring to the same variable and rename everything.Tophat
echo
tag, etc.)Before you deploy
changeset