aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion/completion_config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/completion/completion_config.rs')
-rw-r--r--crates/ra_ide/src/completion/completion_config.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/completion_config.rs b/crates/ra_ide/src/completion/completion_config.rs
new file mode 100644
index 000000000..6cf7ed6e4
--- /dev/null
+++ b/crates/ra_ide/src/completion/completion_config.rs
@@ -0,0 +1,29 @@
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
7#[derive(Clone, Debug, PartialEq, Eq)]
8pub struct CompletionConfig {
9 pub enable_postfix_completions: bool,
10 pub add_call_parenthesis: 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: (),
18}
19
20impl Default for CompletionConfig {
21 fn default() -> Self {
22 CompletionConfig {
23 enable_postfix_completions: true,
24 add_call_parenthesis: true,
25 add_call_argument_snippets: true,
26 snippet_cap: Some(SnippetCap { _private: () }),
27 }
28 }
29}