aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-24 01:06:12 +0100
committerAleksey Kladov <[email protected]>2020-04-24 01:06:12 +0100
commitb3050bded1e7a874da265d94dc32c4a98bc98390 (patch)
treef6cf82956933e7ff53e4cfcc34a0e15c53889b86 /crates/ra_ide/src/completion
parentbd3b2393903de2fc98a50426f36d14dc7e86d8da (diff)
Introduce internal snippet cap
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r--crates/ra_ide/src/completion/completion_config.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/completion_config.rs b/crates/ra_ide/src/completion/completion_config.rs
index c01a8f608..6cf7ed6e4 100644
--- a/crates/ra_ide/src/completion/completion_config.rs
+++ b/crates/ra_ide/src/completion/completion_config.rs
@@ -1,8 +1,20 @@
1//! Settings for tweaking completion.
2//!
3//! The fun thing here is `SnippetCap` -- this type can only be created in this
4//! module, and we use to statically check that we only produce snippet
5//! completions if we are allowed to.
6
1#[derive(Clone, Debug, PartialEq, Eq)] 7#[derive(Clone, Debug, PartialEq, Eq)]
2pub struct CompletionConfig { 8pub struct CompletionConfig {
3 pub enable_postfix_completions: bool, 9 pub enable_postfix_completions: bool,
4 pub add_call_parenthesis: bool, 10 pub add_call_parenthesis: bool,
5 pub add_call_argument_snippets: bool, 11 pub add_call_argument_snippets: bool,
12 pub snippet_cap: Option<SnippetCap>,
13}
14
15#[derive(Clone, Copy, Debug, PartialEq, Eq)]
16pub struct SnippetCap {
17 _private: (),
6} 18}
7 19
8impl Default for CompletionConfig { 20impl Default for CompletionConfig {
@@ -11,6 +23,7 @@ impl Default for CompletionConfig {
11 enable_postfix_completions: true, 23 enable_postfix_completions: true,
12 add_call_parenthesis: true, 24 add_call_parenthesis: true,
13 add_call_argument_snippets: true, 25 add_call_argument_snippets: true,
26 snippet_cap: Some(SnippetCap { _private: () }),
14 } 27 }
15 } 28 }
16} 29}