diff options
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r-- | crates/ra_ide/src/completion/completion_config.rs | 13 |
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)] |
2 | pub struct CompletionConfig { | 8 | pub 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)] | ||
16 | pub struct SnippetCap { | ||
17 | _private: (), | ||
6 | } | 18 | } |
7 | 19 | ||
8 | impl Default for CompletionConfig { | 20 | impl 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 | } |