aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers/auto_import.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/assists/src/handlers/auto_import.rs')
-rw-r--r--crates/assists/src/handlers/auto_import.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/assists/src/handlers/auto_import.rs b/crates/assists/src/handlers/auto_import.rs
index b5eb2c722..5a1b5a4ac 100644
--- a/crates/assists/src/handlers/auto_import.rs
+++ b/crates/assists/src/handlers/auto_import.rs
@@ -1,6 +1,5 @@
1use std::collections::BTreeSet; 1use std::collections::BTreeSet;
2 2
3use ast::make;
4use either::Either; 3use either::Either;
5use hir::{ 4use hir::{
6 AsAssocItem, AssocItemContainer, ModPath, Module, ModuleDef, PathResolution, Semantics, Trait, 5 AsAssocItem, AssocItemContainer, ModPath, Module, ModuleDef, PathResolution, Semantics, Trait,
@@ -54,11 +53,8 @@ pub(crate) fn auto_import(acc: &mut Assists, ctx: &AssistContext) -> Option<()>
54 format!("Import `{}`", &import), 53 format!("Import `{}`", &import),
55 range, 54 range,
56 |builder| { 55 |builder| {
57 let new_syntax = insert_use( 56 let new_syntax =
58 &scope, 57 insert_use(&scope, import.to_ast_path(), ctx.config.insert_use.merge);
59 make::path_from_text(&import.to_string()),
60 ctx.config.insert_use.merge,
61 );
62 builder.replace(syntax.text_range(), new_syntax.to_string()) 58 builder.replace(syntax.text_range(), new_syntax.to_string())
63 }, 59 },
64 ); 60 );