Don't insert imports outside of cfg attributed items
This commit is contained in:
@@ -8,7 +8,7 @@ use parser::SyntaxKind;
|
||||
use rowan::{GreenNodeData, GreenTokenData};
|
||||
|
||||
use crate::{
|
||||
ast::{self, support, AstNode, AstToken, AttrsOwner, NameOwner, SyntaxNode},
|
||||
ast::{self, support, AstChildren, AstNode, AstToken, AttrsOwner, NameOwner, SyntaxNode},
|
||||
NodeOrToken, SmolStr, SyntaxElement, SyntaxToken, TokenText, T,
|
||||
};
|
||||
|
||||
@@ -45,6 +45,12 @@ fn text_of_first_token(node: &SyntaxNode) -> TokenText<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::BlockExpr {
|
||||
pub fn items(&self) -> AstChildren<ast::Item> {
|
||||
support::children(self.syntax())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
pub enum Macro {
|
||||
MacroRules(ast::MacroRules),
|
||||
|
||||
Reference in New Issue
Block a user