diff options
author | Aleksey Kladov <[email protected]> | 2020-05-20 09:20:21 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-05-20 09:20:21 +0100 |
commit | 45e343a0ef6f4caf078811d0664907610f085d54 (patch) | |
tree | f059c318e3562d6af9cb40feb0b1d3b93d945f9e /crates/ra_assists/src/handlers | |
parent | 9b2bd022dc6fbe13356622ada5b6499f012cb5ae (diff) |
Minor
Diffstat (limited to 'crates/ra_assists/src/handlers')
-rw-r--r-- | crates/ra_assists/src/handlers/auto_import.rs | 7 | ||||
-rw-r--r-- | crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/auto_import.rs b/crates/ra_assists/src/handlers/auto_import.rs index 78d23150d..f6d25579e 100644 --- a/crates/ra_assists/src/handlers/auto_import.rs +++ b/crates/ra_assists/src/handlers/auto_import.rs | |||
@@ -50,7 +50,12 @@ pub(crate) fn auto_import(acc: &mut Assists, ctx: &AssistContext) -> Option<()> | |||
50 | format!("Import `{}`", &import), | 50 | format!("Import `{}`", &import), |
51 | range, | 51 | range, |
52 | |builder| { | 52 | |builder| { |
53 | insert_use_statement(&auto_import_assets.syntax_under_caret, &import, ctx, builder); | 53 | insert_use_statement( |
54 | &auto_import_assets.syntax_under_caret, | ||
55 | &import, | ||
56 | ctx, | ||
57 | builder.text_edit_builder(), | ||
58 | ); | ||
54 | }, | 59 | }, |
55 | ); | 60 | ); |
56 | } | 61 | } |
diff --git a/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs b/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs index 1a81d8a0e..d9f84208d 100644 --- a/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs +++ b/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs | |||
@@ -39,7 +39,7 @@ pub(crate) fn replace_qualified_name_with_use( | |||
39 | target, | 39 | target, |
40 | |builder| { | 40 | |builder| { |
41 | let path_to_import = hir_path.mod_path().clone(); | 41 | let path_to_import = hir_path.mod_path().clone(); |
42 | insert_use_statement(path.syntax(), &path_to_import, ctx, builder); | 42 | insert_use_statement(path.syntax(), &path_to_import, ctx, builder.text_edit_builder()); |
43 | 43 | ||
44 | if let Some(last) = path.segment() { | 44 | if let Some(last) = path.segment() { |
45 | // Here we are assuming the assist will provide a correct use statement | 45 | // Here we are assuming the assist will provide a correct use statement |