Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/expand_glob_import.rs')
-rw-r--r--crates/ide-assists/src/handlers/expand_glob_import.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ide-assists/src/handlers/expand_glob_import.rs b/crates/ide-assists/src/handlers/expand_glob_import.rs
index 79b9f5d69a..da6900b99b 100644
--- a/crates/ide-assists/src/handlers/expand_glob_import.rs
+++ b/crates/ide-assists/src/handlers/expand_glob_import.rs
@@ -8,7 +8,7 @@ use ide_db::{
use stdx::never;
use syntax::{
AstNode, Direction, SyntaxNode, SyntaxToken, T,
- ast::{self, Use, UseTree, VisibilityKind, syntax_factory::SyntaxFactory},
+ ast::{self, Use, UseTree, VisibilityKind},
};
use crate::{
@@ -148,7 +148,6 @@ fn build_expanded_import(
current_module: Module,
reexport_public_items: bool,
) {
- let make = SyntaxFactory::with_mappings();
let mut editor = builder.make_editor(use_tree.syntax());
let (must_be_pub, visible_from) = if !reexport_public_items {
(false, current_module)
@@ -169,11 +168,11 @@ fn build_expanded_import(
if reexport_public_items { refs_in_target } else { refs_in_target.used_refs(ctx) };
let names_to_import = find_names_to_import(filtered_defs, imported_defs);
- let expanded = make.use_tree_list(names_to_import.iter().map(|n| {
- let path = make.ident_path(
+ let expanded = editor.make().use_tree_list(names_to_import.iter().map(|n| {
+ let path = editor.make().ident_path(
&n.display(ctx.db(), current_module.krate(ctx.db()).edition(ctx.db())).to_string(),
);
- make.use_tree(path, None, None, false)
+ editor.make().use_tree(path, None, None, false)
}));
match use_tree.star_token() {
@@ -192,7 +191,6 @@ fn build_expanded_import(
}
None => never!(),
}
- editor.add_mappings(make.finish_with_mappings());
builder.add_file_edits(ctx.vfs_file_id(), editor);
}