Implement postfix completions feature flag

This commit is contained in:
Greg 2019-11-11 22:55:10 -05:00
parent 602f11f27b
commit eb72156094
No known key found for this signature in database
GPG Key ID: 2E44FAEEDC94B1E2
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("completions.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,
}