mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Fixup emitted whitespace in most cases
This commit is contained in:
parent
6181154d50
commit
ea02d27a1e
3 changed files with 97 additions and 31 deletions
|
@ -188,6 +188,12 @@ fn ws_between(left: &SyntaxElement, right: &SyntaxElement) -> Option<SyntaxToken
|
|||
return None;
|
||||
}
|
||||
|
||||
if left.kind() == T!['{'] && right.kind() == SyntaxKind::LET_STMT {
|
||||
let mut indent = IndentLevel::from_element(left);
|
||||
indent.0 += 1;
|
||||
return Some(make::tokens::whitespace(&format!("\n{}", indent)));
|
||||
}
|
||||
|
||||
if right.kind() == SyntaxKind::USE {
|
||||
let mut indent = IndentLevel::from_element(left);
|
||||
if left.kind() == SyntaxKind::USE {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue