diff options
author | Kirill Bulatov <[email protected]> | 2020-02-07 21:35:34 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2020-02-07 21:53:08 +0000 |
commit | 740a26b7d26a68cc46becda3cca39091e8da67fc (patch) | |
tree | a31418ad219ef3cf66f93b43a37245398f151115 /crates/ra_ide/src/completion/complete_scope.rs | |
parent | 5397f05bfe7f3b18229a65040c6685e762b2f9a3 (diff) |
Rename add import assist
Diffstat (limited to 'crates/ra_ide/src/completion/complete_scope.rs')
-rw-r--r-- | crates/ra_ide/src/completion/complete_scope.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/ra_ide/src/completion/complete_scope.rs b/crates/ra_ide/src/completion/complete_scope.rs index 64b04ec2b..aaa9985d4 100644 --- a/crates/ra_ide/src/completion/complete_scope.rs +++ b/crates/ra_ide/src/completion/complete_scope.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use ra_assists::auto_import_text_edit; | 3 | use ra_assists::insert_use_statement; |
4 | use ra_syntax::{ast, AstNode, SmolStr}; | 4 | use ra_syntax::{ast, AstNode, SmolStr}; |
5 | use ra_text_edit::TextEditBuilder; | 5 | use ra_text_edit::TextEditBuilder; |
6 | use rustc_hash::FxHashMap; | 6 | use rustc_hash::FxHashMap; |
@@ -26,12 +26,7 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) { | |||
26 | let edit = { | 26 | let edit = { |
27 | let mut builder = TextEditBuilder::default(); | 27 | let mut builder = TextEditBuilder::default(); |
28 | builder.replace(ctx.source_range(), name.to_string()); | 28 | builder.replace(ctx.source_range(), name.to_string()); |
29 | auto_import_text_edit( | 29 | insert_use_statement(&ctx.token.parent(), &ctx.token.parent(), &path, &mut builder); |
30 | &ctx.token.parent(), | ||
31 | &ctx.token.parent(), | ||
32 | &path, | ||
33 | &mut builder, | ||
34 | ); | ||
35 | builder.finish() | 30 | builder.finish() |
36 | }; | 31 | }; |
37 | 32 | ||