2216: Implement postfix completions feature flag r=matklad a=chmln

Resolves #2186 

Co-authored-by: Greg <gregory.mkv@gmail.com>
This commit is contained in:
bors[bot] 2019-11-12 05:37:15 +00:00 committed by GitHub
commit aa0646be29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View file

@ -13,6 +13,10 @@ use crate::{
};
pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
if ctx.db.feature_flags.get("completion.enable-postfix") == false {
return;
}
let dot_receiver = match &ctx.dot_receiver {
Some(it) => it,
None => return,

View file

@ -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),
])
}

View file

@ -107,6 +107,8 @@ host.
"lsp.diagnostics": true,
// Automatically insert `()` and `<>` when completing functions and types.
"completion.insertion.add-call-parenthesis": true,
// Enable completions like `.if`, `.match`, etc.
"completion.enable-postfix": true,
// Show notification when workspace is fully loaded
"notifications.workspace-loaded": true,
}