aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/split_import.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/split_import.rs')
-rw-r--r--crates/ra_assists/src/split_import.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_assists/src/split_import.rs b/crates/ra_assists/src/split_import.rs
index a8feb67c8..2c1edddb9 100644
--- a/crates/ra_assists/src/split_import.rs
+++ b/crates/ra_assists/src/split_import.rs
@@ -15,14 +15,14 @@ pub(crate) fn split_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assis
15 return None; 15 return None;
16 } 16 }
17 17
18 let l_curly = colon_colon.range().end(); 18 let l_curly = colon_colon.text_range().end();
19 let r_curly = match top_path.syntax().parent().and_then(ast::UseTree::cast) { 19 let r_curly = match top_path.syntax().parent().and_then(ast::UseTree::cast) {
20 Some(tree) => tree.syntax().range().end(), 20 Some(tree) => tree.syntax().text_range().end(),
21 None => top_path.syntax().range().end(), 21 None => top_path.syntax().text_range().end(),
22 }; 22 };
23 23
24 ctx.add_action(AssistId("split_import"), "split import", |edit| { 24 ctx.add_action(AssistId("split_import"), "split import", |edit| {
25 edit.target(colon_colon.range()); 25 edit.target(colon_colon.text_range());
26 edit.insert(l_curly, "{"); 26 edit.insert(l_curly, "{");
27 edit.insert(r_curly, "}"); 27 edit.insert(r_curly, "}");
28 edit.set_cursor(l_curly + TextUnit::of_str("{")); 28 edit.set_cursor(l_curly + TextUnit::of_str("{"));