1 //! Settings for tweaking assists.
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 //! assists if we are allowed to.
7 #[derive(Clone, Debug, PartialEq, Eq)]
8 pub struct AssistConfig {
9 pub snippet_cap: Option<SnippetCap>,
13 pub fn allow_snippets(&mut self, yes: bool) {
14 self.snippet_cap = if yes { Some(SnippetCap { _private: () }) } else { None }
18 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
19 pub struct SnippetCap {
23 impl Default for AssistConfig {
24 fn default() -> Self {
25 AssistConfig { snippet_cap: Some(SnippetCap { _private: () }) }