mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-29 02:52:11 +00:00
fix: Fix import insertion not being fully cfg aware
This commit is contained in:
parent
cd413d0cac
commit
1f0052a496
12 changed files with 214 additions and 128 deletions
|
|
@ -207,5 +207,12 @@ fn ws_between(left: &SyntaxElement, right: &SyntaxElement) -> Option<SyntaxToken
|
|||
}
|
||||
return Some(make::tokens::whitespace(&format!("\n{indent}")));
|
||||
}
|
||||
if left.kind() == SyntaxKind::ATTR {
|
||||
let mut indent = IndentLevel::from_element(right);
|
||||
if right.kind() == SyntaxKind::ATTR {
|
||||
indent.0 = IndentLevel::from_element(left).0.max(indent.0);
|
||||
}
|
||||
return Some(make::tokens::whitespace(&format!("\n{indent}")));
|
||||
}
|
||||
Some(make::tokens::single_space())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue