diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-24 23:40:05 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-24 23:40:05 +0000 |
commit | 9b512f8569dda32fe2d12114adeed2f612d0190f (patch) | |
tree | de4a605a37481f12db88ae8fc9dc00cd2bc801b0 /crates/completion/src/completions | |
parent | 5478aaebfe4d9d2ad7745702932bf40b2cad226b (diff) | |
parent | 9812150047ea5f53631762e83ed25177e821857f (diff) |
Merge #6631
6631: Gate autoimports begind experimental completions flag r=kjeremy a=SomeoneToIgnore
Part of https://github.com/rust-analyzer/rust-analyzer/issues/6612
Adds a possibility to disable autoimports:
<img width="598" alt="image" src="https://user-images.githubusercontent.com/2690773/100156673-f8037f80-2eb1-11eb-8e74-59ebe4260ba3.png">
and other experimental completions we might want to add later.
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/completion/src/completions')
-rw-r--r-- | crates/completion/src/completions/unqualified_path.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index 86c143b63..4f1c9faa0 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs | |||
@@ -44,7 +44,9 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC | |||
44 | acc.add_resolution(ctx, name.to_string(), &res) | 44 | acc.add_resolution(ctx, name.to_string(), &res) |
45 | }); | 45 | }); |
46 | 46 | ||
47 | fuzzy_completion(acc, ctx).unwrap_or_default() | 47 | if ctx.config.enable_experimental_completions { |
48 | fuzzy_completion(acc, ctx).unwrap_or_default() | ||
49 | } | ||
48 | } | 50 | } |
49 | 51 | ||
50 | fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &Type) { | 52 | fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &Type) { |