pub enum SnippetActivationMode {
Global,
SupportedLanguages,
Off,
}Expand description
snippet.activation — which buffers get snippets.
A closed three-value set (hence a typed enum rather than a
free-form string): Global activates on every real document
buffer; SupportedLanguages activates only for major modes in
the snippet.languages allowlist; Off never auto-activates.
Variants§
Global
Snippets on every document buffer (the default). The
completion source still self-filters by language, so
Global means “each buffer sees its own language’s
snippets”, not “all snippets everywhere”.
SupportedLanguages
Snippets only for languages listed in snippet.languages.
Resolves to Majors([<lang>-mode …]), which matches only
registered major modes.
Off
Snippets disabled — never auto-activate. Explicit
:snippet-mode / <C-x><C-s> paths still work where wired.
Implementations§
Trait Implementations§
Source§impl Clone for SnippetActivationMode
impl Clone for SnippetActivationMode
Source§fn clone(&self) -> SnippetActivationMode
fn clone(&self) -> SnippetActivationMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SnippetActivationMode
Source§impl Debug for SnippetActivationMode
impl Debug for SnippetActivationMode
Source§impl Default for SnippetActivationMode
impl Default for SnippetActivationMode
Source§fn default() -> SnippetActivationMode
fn default() -> SnippetActivationMode
impl Eq for SnippetActivationMode
Source§impl OptionType for SnippetActivationMode
impl OptionType for SnippetActivationMode
Source§fn enumerate_is_exhaustive() -> bool
fn enumerate_is_exhaustive() -> bool
TC.1: closed — parse accepts these forms and nothing else, so
the schema is an enum and :customize can offer a picker.
Source§fn parse(s: &str) -> Result<Self, String>
fn parse(s: &str) -> Result<Self, String>
:set name=value. Errors are
surfaced verbatim through the cmdline echo, so the message
should read well to the user (mention valid forms when the
space is finite). The parser MUST round-trip with format:
T::parse(&v.format()) == Ok(v) for every v.Source§fn format(&self) -> String
fn format(&self) -> String
:set foo? echo,
the customize buffer view, value comparison). Round-trips
with [Self::parse].Source§fn type_label() -> &'static str
fn type_label() -> &'static str
:describe-option ("boolean",
"foldmethod", etc.). Used in help bodies and the customize
buffer view.Source§fn enumerate() -> Option<Vec<&'static str>>
fn enumerate() -> Option<Vec<&'static str>>
:set foo=<Tab>
completion. None means “free-form” (no enumerable space –
integers, file paths, free strings). The values are
&'static str to keep the completion source allocation-free
in the common case.§fn enumerate_with_docs() -> Option<Vec<EnumeratedValue>>
fn enumerate_with_docs() -> Option<Vec<EnumeratedValue>>
Self::enumerate] with empty docs;
types with rich help override. Read more§fn name_forms(_canonical: &str) -> Vec<String>
fn name_forms(_canonical: &str) -> Vec<String>
:set nu / :set nonu). Default:
no extra forms. Booleans return [format!("no{canonical}")].§fn is_bool() -> bool
fn is_bool() -> bool
:set noFOO. bool
returns true; everything else false. Drives the negate
path in the cmdline parser.§fn accepts_list() -> bool
fn accepts_list() -> bool
Self::parse] accepts, rather than rejected
as “not applicable to a scalar option”. false for every
scalar type (the default); true for list types like
[crate::ModelineZone]. Drives loader::apply_array (ML.5).
The :set cmdline path is unaffected — it always passes a
string and never sees a TOML array.§fn try_negation_value() -> Result<Self, String>
fn try_negation_value() -> Result<Self, String>
Self::is_bool] true).
Default: returns Err – the registry guards by checking
is_bool() first, so callers that respect the contract
won’t observe this. The bool impl returns Ok(false).§fn from_value(value: &ConfigValue) -> Result<Self, String>
fn from_value(value: &ConfigValue) -> Result<Self, String>
Self::to_value],
deferring to parse so a type’s validation rules apply on this
path exactly as they do on :set.Source§impl PartialEq for SnippetActivationMode
impl PartialEq for SnippetActivationMode
impl StructuralPartialEq for SnippetActivationMode
Auto Trait Implementations§
impl Freeze for SnippetActivationMode
impl RefUnwindSafe for SnippetActivationMode
impl Send for SnippetActivationMode
impl Sync for SnippetActivationMode
impl Unpin for SnippetActivationMode
impl UnsafeUnpin for SnippetActivationMode
impl UnwindSafe for SnippetActivationMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.