diff options
author | Aleksey Kladov <[email protected]> | 2019-07-20 10:58:27 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-07-20 10:58:27 +0100 |
commit | f3bdbec1b68fa0e20f0b7b6c6ef64e1507970b0d (patch) | |
tree | f2cb82f74d2d60d5351c3d7c4d8e7bce4d351cab /crates/ra_assists/src/split_import.rs | |
parent | 6d5d82e412dea19ea48eecc6f7d5a4aa223a9599 (diff) |
rename range -> text_range
Diffstat (limited to 'crates/ra_assists/src/split_import.rs')
-rw-r--r-- | crates/ra_assists/src/split_import.rs | 8 |
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("{")); |