File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -150,18 +150,17 @@ pub fn append_child_raw(node: &(impl Into<SyntaxNode> + Clone), child: impl Elem
150
150
fn ws_before ( position : & Position , new : & SyntaxElement ) -> Option < SyntaxToken > {
151
151
let prev = match & position. repr {
152
152
PositionRepr :: FirstChild ( _) => return None ,
153
- PositionRepr :: After ( it) if it. kind ( ) == SyntaxKind :: L_CURLY => {
154
- if new. kind ( ) == SyntaxKind :: USE {
155
- if let Some ( item_list) = it. parent ( ) . and_then ( ast:: ItemList :: cast) {
156
- let mut indent = IndentLevel :: from_element ( & item_list. syntax ( ) . clone ( ) . into ( ) ) ;
157
- indent. 0 += 1 ;
158
- return Some ( make:: tokens:: whitespace ( & format ! ( "\n {}" , indent) ) ) ;
159
- }
160
- }
161
- it
162
- }
163
153
PositionRepr :: After ( it) => it,
164
154
} ;
155
+
156
+ if prev. kind ( ) == T ! [ '{' ] && new. kind ( ) == SyntaxKind :: USE {
157
+ if let Some ( item_list) = prev. parent ( ) . and_then ( ast:: ItemList :: cast) {
158
+ let mut indent = IndentLevel :: from_element ( & item_list. syntax ( ) . clone ( ) . into ( ) ) ;
159
+ indent. 0 += 1 ;
160
+ return Some ( make:: tokens:: whitespace ( & format ! ( "\n {}" , indent) ) ) ;
161
+ }
162
+ }
163
+
165
164
ws_between ( prev, new)
166
165
}
167
166
fn ws_after ( position : & Position , new : & SyntaxElement ) -> Option < SyntaxToken > {
You can’t perform that action at this time.
0 commit comments