diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_ide/src/completion/completion_config.rs | 13 | ||||
-rw-r--r-- | crates/rust-analyzer/src/config.rs | 1 |
2 files changed, 14 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 | } |
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 642c34574..33d7c95a8 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs | |||
@@ -104,6 +104,7 @@ impl Default for Config { | |||
104 | enable_postfix_completions: true, | 104 | enable_postfix_completions: true, |
105 | add_call_parenthesis: true, | 105 | add_call_parenthesis: true, |
106 | add_call_argument_snippets: true, | 106 | add_call_argument_snippets: true, |
107 | ..CompletionConfig::default() | ||
107 | }, | 108 | }, |
108 | call_info_full: true, | 109 | call_info_full: true, |
109 | } | 110 | } |