-
Notifications
You must be signed in to change notification settings - Fork 29
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] Modify paramDescription to be null if empty #737
Conversation
6234d28
to
3cf8be9
Compare
3cf8be9
to
dd0cd4d
Compare
@@ -1974,7 +1974,8 @@ function toHtmlSelfClosingElement( | |||
} | |||
|
|||
function toNullableTextNode(node: ConcreteTextNode | null): TextNode | null { | |||
if (!node) return null; | |||
if (!node || node.value === '') return 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.
@charlespwd I would prefer to update the ohm
logic, but it wasn't so straightforward since paramDescription
is always matched.
Wanted to get a sanity check on this decision, or some help editing ohm
!
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.
The updated tests look good. Thanks for the follow-up PR. 👍
@@ -33,6 +33,7 @@ describe('Unit: makeGetLiquidDocDefinitions', () => { | |||
@param {Number} secondParam - The second param | |||
@param paramWithNoType - param with no type | |||
@param paramWithOnlyName | |||
@param {Number} paramWithNoDescription |
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.
you should also include a test for free-form text to see if it gets picked up by getSnippetDefinition
What are you adding in this PR?
Returns
null
in theliquid-html-parser
ifparamDescription
value is''
.Also added some test coverage in the language server for this case.
stage-2
, though we could revisit thischangeset