aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/utils')
-rw-r--r--crates/ra_assists/src/utils/insert_use.rs6
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};
12use ra_text_edit::TextEditBuilder; 12use ra_text_edit::TextEditBuilder;
13 13
14use crate::assist_context::{AssistBuilder, AssistContext}; 14use 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