From 4c95c6e25d7765798fc527f11beb6c039c6adabe Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 25 Nov 2020 00:02:45 +0200 Subject: Gate autoimports begind experimental completions flag --- crates/completion/src/completions/unqualified_path.rs | 4 +++- crates/completion/src/config.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/completion') 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 acc.add_resolution(ctx, name.to_string(), &res) }); - fuzzy_completion(acc, ctx).unwrap_or_default() + if ctx.config.enable_experimental_completions { + fuzzy_completion(acc, ctx).unwrap_or_default() + } } fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &Type) { diff --git a/crates/completion/src/config.rs b/crates/completion/src/config.rs index 82874ff25..f50735372 100644 --- a/crates/completion/src/config.rs +++ b/crates/completion/src/config.rs @@ -9,6 +9,7 @@ use assists::utils::MergeBehaviour; #[derive(Clone, Debug, PartialEq, Eq)] pub struct CompletionConfig { pub enable_postfix_completions: bool, + pub enable_experimental_completions: bool, pub add_call_parenthesis: bool, pub add_call_argument_snippets: bool, pub snippet_cap: Option, @@ -30,6 +31,7 @@ impl Default for CompletionConfig { fn default() -> Self { CompletionConfig { enable_postfix_completions: true, + enable_experimental_completions: true, add_call_parenthesis: true, add_call_argument_snippets: true, snippet_cap: Some(SnippetCap { _private: () }), -- cgit v1.2.3