mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-16 17:58:16 +00:00
Merge #2216
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:
commit
aa0646be29
3 changed files with 7 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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),
|
||||
])
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue