File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ impl<'a> Translator<'a> {
272272 ) {
273273 for child in children {
274274 if let NodeOrToken :: Token ( token) = child {
275- if token. kind ( ) == SyntaxKind :: COMMENT {
275+ if token. kind ( ) == SyntaxKind :: COMMENT && self . source_kind == SourceKind :: Source {
276276 let label = self . trap . emit ( generated:: Comment {
277277 id : TrapId :: Star ,
278278 parent : parent_label,
@@ -655,6 +655,9 @@ impl<'a> Translator<'a> {
655655 pub ( crate ) fn should_be_excluded ( & self , item : & impl ast:: AstNode ) -> bool {
656656 if self . source_kind == SourceKind :: Library {
657657 let syntax = item. syntax ( ) ;
658+ if syntax. kind ( ) == SyntaxKind :: TOKEN_TREE {
659+ return true ;
660+ }
658661 if syntax
659662 . parent ( )
660663 . and_then ( Fn :: cast)
You can’t perform that action at this time.
0 commit comments