File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1745,6 +1745,7 @@ impl Parser<'_> {
17451745 let s = span. as_str ( self . inputs , |s| s. trim_start_matches ( "#" ) . trim ( ) . into ( ) ) ;
17461746 lines. push ( span. sp ( s) ) ;
17471747 } else if let Some ( sem) = self . next_token_map ( Token :: as_semantic_comment) {
1748+ lines. push ( sem. span . clone ( ) . sp ( sem. value . to_string ( ) . into ( ) ) ) ;
17481749 semantic. insert ( sem. value , sem. span ) ;
17491750 } else {
17501751 break ;
Original file line number Diff line number Diff line change @@ -377,6 +377,11 @@ impl Spanner {
377377 spans. push ( prev. end_to ( & curr) . sp ( SpanKind :: Whitespace ) )
378378 }
379379 }
380+ if let Some ( comments) = & field. comments {
381+ for line in & comments. lines {
382+ spans. push ( line. span . clone ( ) . sp ( SpanKind :: Comment ) ) ;
383+ }
384+ }
380385 spans. push ( field. name . span . clone ( ) . sp ( SpanKind :: Ident {
381386 docs : self . binding_docs ( & field. name . span ) ,
382387 original : true ,
You can’t perform that action at this time.
0 commit comments