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/utils | |
parent | 9b2bd022dc6fbe13356622ada5b6499f012cb5ae (diff) |
Minor
Diffstat (limited to 'crates/ra_assists/src/utils')
-rw-r--r-- | crates/ra_assists/src/utils/insert_use.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/utils/insert_use.rs b/crates/ra_assists/src/utils/insert_use.rs index 1214e3cd4..0ee43482f 100644 --- a/crates/ra_assists/src/utils/insert_use.rs +++ b/crates/ra_assists/src/utils/insert_use.rs | |||
@@ -11,7 +11,7 @@ use ra_syntax::{ | |||
11 | }; | 11 | }; |
12 | use ra_text_edit::TextEditBuilder; | 12 | use ra_text_edit::TextEditBuilder; |
13 | 13 | ||
14 | use crate::assist_context::{AssistBuilder, AssistContext}; | 14 | use crate::assist_context::AssistContext; |
15 | 15 | ||
16 | /// Creates and inserts a use statement for the given path to import. | 16 | /// Creates and inserts a use statement for the given path to import. |
17 | /// The use statement is inserted in the scope most appropriate to the | 17 | /// The use statement is inserted in the scope most appropriate to the |
@@ -21,7 +21,7 @@ pub(crate) fn insert_use_statement( | |||
21 | position: &SyntaxNode, | 21 | position: &SyntaxNode, |
22 | path_to_import: &ModPath, | 22 | path_to_import: &ModPath, |
23 | ctx: &AssistContext, | 23 | ctx: &AssistContext, |
24 | builder: &mut AssistBuilder, | 24 | builder: &mut TextEditBuilder, |
25 | ) { | 25 | ) { |
26 | let target = path_to_import.to_string().split("::").map(SmolStr::new).collect::<Vec<_>>(); | 26 | let target = path_to_import.to_string().split("::").map(SmolStr::new).collect::<Vec<_>>(); |
27 | let container = ctx.sema.ancestors_with_macros(position.clone()).find_map(|n| { | 27 | let container = ctx.sema.ancestors_with_macros(position.clone()).find_map(|n| { |
@@ -33,7 +33,7 @@ pub(crate) fn insert_use_statement( | |||
33 | 33 | ||
34 | if let Some(container) = container { | 34 | if let Some(container) = container { |
35 | let action = best_action_for_target(container, position.clone(), &target); | 35 | let action = best_action_for_target(container, position.clone(), &target); |
36 | make_assist(&action, &target, builder.text_edit_builder()); | 36 | make_assist(&action, &target, builder); |
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||