File tree Expand file tree Collapse file tree 4 files changed +12
-11
lines changed
Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -521,7 +521,8 @@ let rec new_comments_inner =
521521
522522 | 1 => [
523523 switch (prev_cmt) {
524- | Line (_ ) => Doc . nil
524+ | Line (_ )
525+ | Doc (_ ) => Doc . nil
525526 | _ => Doc . hardLine
526527 },
527528 comment_to_doc(cmt),
Original file line number Diff line number Diff line change @@ -4187,14 +4187,6 @@ let format_ast =
41874187 toplevel_print(~original_source, ~comments, stmt);
41884188 };
41894189
4190- let leading_comments = [] ;
4191-
4192- let cleaned_comments =
4193- remove_used_comments(
4194- ~remove_comments= leading_comments,
4195- parsed_program. comments,
4196- );
4197-
41984190 let get_attributes = (stmt: Parsetree . toplevel_stmt ) => {
41994191 let attributes = stmt. ptop_attributes;
42004192 print_attributes(attributes);
@@ -4204,14 +4196,14 @@ let format_ast =
42044196
42054197 let final_doc =
42064198 switch (parsed_program. statements) {
4207- | [] => Comment_utils . new_comments_to_docs(cleaned_comments )
4199+ | [] => Comment_utils . new_comments_to_docs(parsed_program . comments )
42084200 | _ =>
42094201 let top_level_stmts =
42104202 block_item_iterator(
42114203 ~previous= TopOfFile ,
42124204 ~get_loc,
42134205 ~print_item,
4214- ~comments= cleaned_comments ,
4206+ ~comments= parsed_program . comments ,
42154207 ~print_attribute= get_attributes,
42164208 ~original_source,
42174209 parsed_program. statements,
Original file line number Diff line number Diff line change 55
66let myfun = (/* a */ x /*post*/, y) => 10
77
8+ /**
9+ * Then a doc
10+ */
11+ // Then a line
812let myfun1 = (/* a */ x , y) => 10
913
1014let myfun2 = (x /*post*/, y) => 10
Original file line number Diff line number Diff line change 55
66let myfun = (/* a */ x, /*post*/ y) => 10
77
8+ /**
9+ * Then a doc
10+ */
11+ // Then a line
812let myfun1 = (/* a */ x, y) => 10
913
1014let myfun2 = (x, /*post*/ y) => 10
You can’t perform that action at this time.
0 commit comments