File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -4842,9 +4842,22 @@ and print_arguments_with_callback_in_last_position ~state args cmt_tbl =
4842
4842
and print_arguments ~state ?(partial = false )
4843
4843
(args : (Asttypes.arg_label * Parsetree.expression) list ) cmt_tbl =
4844
4844
match args with
4845
- | [(Nolabel , {pexp_desc = Pexp_construct ({txt = Longident. Lident " ()" }, _)})]
4846
- ->
4847
- Doc. text " ()"
4845
+ | [
4846
+ ( Nolabel ,
4847
+ {
4848
+ pexp_desc = Pexp_construct ({txt = Longident. Lident " ()" }, _);
4849
+ pexp_loc = loc;
4850
+ } );
4851
+ ] ->
4852
+ if has_leading_line_comment cmt_tbl loc then
4853
+ let cmt = print_comments Doc. nil cmt_tbl loc in
4854
+ Doc. concat
4855
+ [
4856
+ Doc. lparen;
4857
+ Doc. indent (Doc. group (Doc. concat [Doc. soft_line; cmt]));
4858
+ Doc. rparen;
4859
+ ]
4860
+ else Doc. text " ()"
4848
4861
| [(Nolabel , arg)] when ParsetreeViewer. is_huggable_expression arg ->
4849
4862
let arg_doc =
4850
4863
let doc = print_expression_with_comments ~state arg cmt_tbl in
You can’t perform that action at this time.
0 commit comments