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<'_> {
1745
1745
let s = span. as_str ( self . inputs , |s| s. trim_start_matches ( "#" ) . trim ( ) . into ( ) ) ;
1746
1746
lines. push ( span. sp ( s) ) ;
1747
1747
} 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 ( ) ) ) ;
1748
1749
semantic. insert ( sem. value , sem. span ) ;
1749
1750
} else {
1750
1751
break ;
Original file line number Diff line number Diff line change @@ -377,6 +377,11 @@ impl Spanner {
377
377
spans. push ( prev. end_to ( & curr) . sp ( SpanKind :: Whitespace ) )
378
378
}
379
379
}
380
+ if let Some ( comments) = & field. comments {
381
+ for line in & comments. lines {
382
+ spans. push ( line. span . clone ( ) . sp ( SpanKind :: Comment ) ) ;
383
+ }
384
+ }
380
385
spans. push ( field. name . span . clone ( ) . sp ( SpanKind :: Ident {
381
386
docs : self . binding_docs ( & field. name . span ) ,
382
387
original : true ,
You can’t perform that action at this time.
0 commit comments