Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes

This commit is contained in:
Seivan Heidari 2019-11-12 09:46:35 +01:00
commit 11755f3eff
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) { 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 { let dot_receiver = match &ctx.dot_receiver {
Some(it) => it, Some(it) => it,
None => return, None => return,

View file

@ -54,6 +54,7 @@ impl Default for FeatureFlags {
FeatureFlags::new(&[ FeatureFlags::new(&[
("lsp.diagnostics", true), ("lsp.diagnostics", true),
("completion.insertion.add-call-parenthesis", true), ("completion.insertion.add-call-parenthesis", true),
("completion.enable-postfix", true),
("notifications.workspace-loaded", true), ("notifications.workspace-loaded", true),
]) ])
} }

View file

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