File tree 3 files changed +25
-6
lines changed
packages/prettier-plugin-liquid/src
3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -513,12 +513,21 @@ export function printLiquidDocParam(
513
513
_args : LiquidPrinterArgs ,
514
514
) : Doc {
515
515
const node = path . getValue ( ) ;
516
- return [
517
- node . name ,
518
- ' ' ,
519
- node . paramName . value ,
520
- node . paramDescription . value ? ' ' + node . paramDescription . value : '' ,
521
- ] ;
516
+ const parts : Doc [ ] = [ '@param' ] ;
517
+
518
+ if ( node . paramType . value ) {
519
+ parts . push ( ' ' , `{${ node . paramType . value } }` ) ;
520
+ }
521
+
522
+ if ( node . paramName . value ) {
523
+ parts . push ( ' ' , node . paramName . value ) ;
524
+ }
525
+
526
+ if ( node . paramDescription . value ) {
527
+ parts . push ( ' ' , node . paramDescription . value ) ;
528
+ }
529
+
530
+ return parts ;
522
531
}
523
532
524
533
function innerLeadingWhitespace ( node : LiquidTag | LiquidBranch ) {
Original file line number Diff line number Diff line change @@ -12,3 +12,8 @@ It should trim whitespace between nodes
12
12
{% doc %}
13
13
@param paramName param with description
14
14
{% enddoc %}
15
+
16
+ It should format the param type
17
+ {% doc %}
18
+ @param {string} paramName param with description
19
+ {% enddoc %}
Original file line number Diff line number Diff line change @@ -12,3 +12,8 @@ It should trim whitespace between nodes
12
12
{% doc %}
13
13
@param paramName param with description
14
14
{% enddoc %}
15
+
16
+ It should format the param type
17
+ {% doc %}
18
+ @param { string } paramName param with description
19
+ {% enddoc %}
You can’t perform that action at this time.
0 commit comments