From eb72156094ce88c85c55e821026686c66bd0736d Mon Sep 17 00:00:00 2001 From: Greg Date: Mon, 11 Nov 2019 22:55:10 -0500 Subject: Implement postfix completions feature flag --- crates/ra_ide_api/src/completion/complete_postfix.rs | 4 ++++ crates/ra_ide_api/src/feature_flags.rs | 1 + 2 files changed, 5 insertions(+) (limited to 'crates') diff --git a/crates/ra_ide_api/src/completion/complete_postfix.rs b/crates/ra_ide_api/src/completion/complete_postfix.rs index 4f9565441..a3e9e5f46 100644 --- a/crates/ra_ide_api/src/completion/complete_postfix.rs +++ b/crates/ra_ide_api/src/completion/complete_postfix.rs @@ -13,6 +13,10 @@ use crate::{ }; pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { + if ctx.db.feature_flags.get("completions.enable-postfix") == false { + return; + } + let dot_receiver = match &ctx.dot_receiver { Some(it) => it, None => return, diff --git a/crates/ra_ide_api/src/feature_flags.rs b/crates/ra_ide_api/src/feature_flags.rs index d3ca7be03..de4ae513d 100644 --- a/crates/ra_ide_api/src/feature_flags.rs +++ b/crates/ra_ide_api/src/feature_flags.rs @@ -54,6 +54,7 @@ impl Default for FeatureFlags { FeatureFlags::new(&[ ("lsp.diagnostics", true), ("completion.insertion.add-call-parenthesis", true), + ("completion.enable-postfix", true), ("notifications.workspace-loaded", true), ]) } -- cgit v1.2.3 From 088e5e172138f9bcaabd022113d92857fa0411e2 Mon Sep 17 00:00:00 2001 From: Greg Date: Mon, 11 Nov 2019 22:56:39 -0500 Subject: fix typo --- crates/ra_ide_api/src/completion/complete_postfix.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/ra_ide_api/src/completion/complete_postfix.rs b/crates/ra_ide_api/src/completion/complete_postfix.rs index a3e9e5f46..99fed8689 100644 --- a/crates/ra_ide_api/src/completion/complete_postfix.rs +++ b/crates/ra_ide_api/src/completion/complete_postfix.rs @@ -13,7 +13,7 @@ use crate::{ }; pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { - if ctx.db.feature_flags.get("completions.enable-postfix") == false { + if ctx.db.feature_flags.get("completion.enable-postfix") == false { return; } -- cgit v1.2.3