diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-09 08:51:56 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-09 08:51:56 +0000 |
commit | 27964cc9e71519ce8e2e0f8bdac76869882f7d8a (patch) | |
tree | f243ea58e6e9f7ff92bd81775cb931c6798ea9ee /crates/ra_ide/src/completion | |
parent | 3e1d97790be166f8735607c552a94a28ab9b09b8 (diff) | |
parent | 740a26b7d26a68cc46becda3cca39091e8da67fc (diff) |
Merge #3052
3052: Rename add import assist r=matklad a=SomeoneToIgnore
Based on the https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/2.20assists.20with.20the.20same.20action.20name/near/187655643 and the related discussion.
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion')
-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 | ||