diff options
Diffstat (limited to 'crates/completion/src/completions/complete_magic.rs')
-rw-r--r-- | crates/completion/src/completions/complete_magic.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/completion/src/completions/complete_magic.rs b/crates/completion/src/completions/complete_magic.rs index 4cf21e19d..58509fc5b 100644 --- a/crates/completion/src/completions/complete_magic.rs +++ b/crates/completion/src/completions/complete_magic.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! TODO kb move this into the complete_unqualified_path when starts to work properly | 1 | //! TODO kb move this into the complete_unqualified_path when starts to work properly |
2 | 2 | ||
3 | use assists::utils::{insert_use, mod_path_to_ast, ImportScope, MergeBehaviour}; | 3 | use assists::utils::{insert_use, mod_path_to_ast, ImportScope}; |
4 | use either::Either; | 4 | use either::Either; |
5 | use hir::{db::HirDatabase, MacroDef, ModuleDef, Query}; | 5 | use hir::{db::HirDatabase, MacroDef, ModuleDef, Query}; |
6 | use itertools::Itertools; | 6 | use itertools::Itertools; |
@@ -48,10 +48,7 @@ pub(crate) fn complete_magic(acc: &mut Completions, ctx: &CompletionContext) -> | |||
48 | ); | 48 | ); |
49 | builder.replace(anchor.syntax().text_range(), correct_qualifier); | 49 | builder.replace(anchor.syntax().text_range(), correct_qualifier); |
50 | 50 | ||
51 | // TODO kb: assists already have the merge behaviour setting, need to unite both | 51 | let rewriter = insert_use(&import_scope, mod_path_to_ast(&mod_path), ctx.config.merge); |
52 | // also consider a settings toggle for this particular feature? | ||
53 | let rewriter = | ||
54 | insert_use(&import_scope, mod_path_to_ast(&mod_path), Some(MergeBehaviour::Full)); | ||
55 | let old_ast = rewriter.rewrite_root()?; | 52 | let old_ast = rewriter.rewrite_root()?; |
56 | algo::diff(&old_ast, &rewriter.rewrite(&old_ast)).into_text_edit(&mut builder); | 53 | algo::diff(&old_ast, &rewriter.rewrite(&old_ast)).into_text_edit(&mut builder); |
57 | 54 | ||