We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 977a197 commit 5d23d47Copy full SHA for 5d23d47
1 file changed
rust/extractor/src/translate/base.rs
@@ -272,7 +272,7 @@ impl<'a> Translator<'a> {
272
) {
273
for child in children {
274
if let NodeOrToken::Token(token) = child {
275
- if token.kind() == SyntaxKind::COMMENT {
+ if token.kind() == SyntaxKind::COMMENT && self.source_kind == SourceKind::Source {
276
let label = self.trap.emit(generated::Comment {
277
id: TrapId::Star,
278
parent: parent_label,
@@ -655,6 +655,9 @@ impl<'a> Translator<'a> {
655
pub(crate) fn should_be_excluded(&self, item: &impl ast::AstNode) -> bool {
656
if self.source_kind == SourceKind::Library {
657
let syntax = item.syntax();
658
+ if syntax.kind() == SyntaxKind::TOKEN_TREE {
659
+ return true;
660
+ }
661
if syntax
662
.parent()
663
.and_then(Fn::cast)
0 commit comments