aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-12 05:37:15 +0000
committerGitHub <[email protected]>2019-11-12 05:37:15 +0000
commitaa0646be29e80db3d8ab3a797b9fadd6c8b2c6e1 (patch)
treec36c534c8eb48fd272c6517956fd31885284c0bc
parent602f11f27bec82ae646b46e5266d8c202c39e431 (diff)
parent088e5e172138f9bcaabd022113d92857fa0411e2 (diff)
Merge #2216
2216: Implement postfix completions feature flag r=matklad a=chmln Resolves #2186 Co-authored-by: Greg <[email protected]>
-rw-r--r--crates/ra_ide_api/src/completion/complete_postfix.rs4
-rw-r--r--crates/ra_ide_api/src/feature_flags.rs1
-rw-r--r--docs/user/README.md2
3 files changed, 7 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..99fed8689 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
15pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { 15pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
16 if ctx.db.feature_flags.get("completion.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 }
diff --git a/docs/user/README.md b/docs/user/README.md
index eb1d5ed14..1861c69ab 100644
--- a/docs/user/README.md
+++ b/docs/user/README.md
@@ -107,6 +107,8 @@ host.
107 "lsp.diagnostics": true, 107 "lsp.diagnostics": true,
108 // Automatically insert `()` and `<>` when completing functions and types. 108 // Automatically insert `()` and `<>` when completing functions and types.
109 "completion.insertion.add-call-parenthesis": true, 109 "completion.insertion.add-call-parenthesis": true,
110 // Enable completions like `.if`, `.match`, etc.
111 "completion.enable-postfix": true,
110 // Show notification when workspace is fully loaded 112 // Show notification when workspace is fully loaded
111 "notifications.workspace-loaded": true, 113 "notifications.workspace-loaded": true,
112 } 114 }