File tree Expand file tree Collapse file tree 3 files changed +20
-14
lines changed
Expand file tree Collapse file tree 3 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -300,22 +300,20 @@ let get_after_brace_comments =
300300 switch (first) {
301301 | None => cmts
302302 | Some (leading ) =>
303- let fstclog = Locations . get_comment_loc(fst);
304-
305- let (_ , itemstartline , itemstartc , _ ) =
303+ let (_ , firststartline , firststartc , _ ) =
306304 Locations . get_raw_pos_info(leading. loc_start);
307305
308- if (itemstartline > startline) {
309- cmts ;
310- } else {
311- let (_ , cmtstartline , cmtstartc , _ ) =
312- Locations . get_raw_pos_info(fstclog . loc_start );
313- if (cmtstartline >= itemstartline && cmtstartc > itemstartc) {
314- [] ;
315- } else {
316- cmts ;
317- } ;
318- } ;
306+ List . filter(
307+ cmt => {
308+ let cmt_loc = Locations . get_comment_loc(cmt) ;
309+ let (_ , cmtendline , cmtendc , _ ) =
310+ Locations . get_raw_pos_info(cmt_loc . loc_end );
311+ cmtendline < firststartline
312+ || cmtendline == firststartline
313+ && cmtendc <= firststartc ;
314+ } ,
315+ cmts ,
316+ ) ;
319317 }
320318 };
321319};
Original file line number Diff line number Diff line change @@ -92,3 +92,5 @@ let { // a comment 3
9292 // comment 2
9393 num: 1, var: A, // end line comment
9494 str: "" }
95+
96+ let y = {/* comment 1 */x, /* comment 2 */longlonglongnamenamename2: 12345, /* comment 3 */ longlonglongnamenamename3: 12345 /* comment 4 */} // end line comment
Original file line number Diff line number Diff line change @@ -110,3 +110,9 @@ let s = { // comment 1
110110 var: A, // end line comment
111111 str: "",
112112}
113+
114+ let y = { /* comment 1 */
115+ x, /* comment 2 */
116+ longlonglongnamenamename2: 12345, /* comment 3 */
117+ longlonglongnamenamename3: 12345, /* comment 4 */
118+ } // end line comment
You can’t perform that action at this time.
0 commit comments