aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_editor/src/typing.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ra_editor/src/typing.rs b/crates/ra_editor/src/typing.rs
index dd3d0f260..5876f9e20 100644
--- a/crates/ra_editor/src/typing.rs
+++ b/crates/ra_editor/src/typing.rs
@@ -256,6 +256,11 @@ fn join_single_use_tree(edit: &mut TextEditBuilder, node: SyntaxNodeRef) -> Opti
256fn compute_ws(left: SyntaxNodeRef, right: SyntaxNodeRef) -> &'static str { 256fn compute_ws(left: SyntaxNodeRef, right: SyntaxNodeRef) -> &'static str {
257 match left.kind() { 257 match left.kind() {
258 L_PAREN | L_BRACK => return "", 258 L_PAREN | L_BRACK => return "",
259 L_CURLY => {
260 if let USE_TREE = right.kind() {
261 return "";
262 }
263 }
259 _ => (), 264 _ => (),
260 } 265 }
261 match right.kind() { 266 match right.kind() {
@@ -331,6 +336,20 @@ fn foo() {
331 } 336 }
332 337
333 #[test] 338 #[test]
339 fn test_join_lines_use_items() {
340 // No space after the '{'
341 check_join_lines(
342 r"
343<|>use ra_syntax::{
344 TextUnit, TextRange,
345};",
346 r"
347<|>use ra_syntax::{TextUnit, TextRange,
348};",
349 );
350 }
351
352 #[test]
334 fn test_join_lines_use_tree() { 353 fn test_join_lines_use_tree() {
335 check_join_lines( 354 check_join_lines(
336 r" 355 r"