-
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
[LiquidDoc] Hover: Wrap optional parameter names in []
#735
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
[]
in hover tooltip ----- Behaviour diverges slightly from JSDoc here. JSDoc does not indicate that it's optional, rather it implicitly adds | undefined
to the types[]
40ad9c4
to
299b434
Compare
a07c1e9
to
9c536a8
Compare
299b434
to
35d7e8f
Compare
8d0f019
to
829655f
Compare
35d7e8f
to
2d086a3
Compare
ca9417b
to
5e111e6
Compare
5e111e6
to
1b37769
Compare
2d086a3
to
9acae35
Compare
1b37769
to
145a221
Compare
9acae35
to
3c791ea
Compare
145a221
to
a7e2320
Compare
3c791ea
to
7038766
Compare
a7e2320
to
5815aec
Compare
7038766
to
fa9a764
Compare
fa9a764
to
dd32d08
Compare
99c1728
to
a7e2320
Compare
dd32d08
to
e0d3790
Compare
e285ac4
to
3eede72
Compare
e0d3790
to
51fe764
Compare
3eede72
to
1a1bb5a
Compare
c085ac9
to
357feaa
Compare
1a1bb5a
to
ddabc90
Compare
ddabc90
to
5312283
Compare
); | ||
}; | ||
|
||
beforeEach(async () => { |
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 want to make extending custom cases easier, rather than having a massive test case that's hard to read / understand
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.
Looks great! One question for discussion, but not required.
private buildParameters(parameters: LiquidDocParameter[]) { | ||
return parameters | ||
.map(({ name, type, description, required }: LiquidDocParameter) => { | ||
const nameStr = required ? `\`${name}\`` : `\`[${name}]\``; |
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 wrote JS doc for a typescript function for optional params. I even had square bracket for optional params, but when you hover over the function, it doesn't show it with square brackets in the hover text.
- Should we do something like for ours as well?
- Or should we have an explicit "optional" after the paramName?


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 like this idea! It's more expressive. Let's go in this direction :)
What are you adding in this PR?
Closes https://github.com/Shopify/develop-advanced-edits/issues/525
Render a
[]
around optional parameters when hovering inside a{% render %}
tagBefore you deploy
changeset