diff options
author | Greg <[email protected]> | 2019-11-12 03:55:10 +0000 |
---|---|---|
committer | Greg <[email protected]> | 2019-11-12 03:55:10 +0000 |
commit | eb72156094ce88c85c55e821026686c66bd0736d (patch) | |
tree | f5d9075e6ec371e6ce29db13e4b10b6b2b188c5d /crates/ra_ide_api | |
parent | 602f11f27bec82ae646b46e5266d8c202c39e431 (diff) |
Implement postfix completions feature flag
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_postfix.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide_api/src/feature_flags.rs | 1 |
2 files changed, 5 insertions, 0 deletions
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::{ | |||
13 | }; | 13 | }; |
14 | 14 | ||
15 | pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { | 15 | pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { |
16 | if ctx.db.feature_flags.get("completions.enable-postfix") == false { | ||
17 | return; | ||
18 | } | ||
19 | |||
16 | let dot_receiver = match &ctx.dot_receiver { | 20 | let dot_receiver = match &ctx.dot_receiver { |
17 | Some(it) => it, | 21 | Some(it) => it, |
18 | None => return, | 22 | 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 { | |||
54 | FeatureFlags::new(&[ | 54 | FeatureFlags::new(&[ |
55 | ("lsp.diagnostics", true), | 55 | ("lsp.diagnostics", true), |
56 | ("completion.insertion.add-call-parenthesis", true), | 56 | ("completion.insertion.add-call-parenthesis", true), |
57 | ("completion.enable-postfix", true), | ||
57 | ("notifications.workspace-loaded", true), | 58 | ("notifications.workspace-loaded", true), |
58 | ]) | 59 | ]) |
59 | } | 60 | } |