Skip to main content

SnippetActivationMode

Enum SnippetActivationMode 

Source
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§

Source§

impl SnippetActivationMode

Source

pub fn label(self) -> &'static str

Canonical :set label.

Source

pub fn parse_label(s: &str) -> Result<Self, String>

Parse a :set snippet.activation=<value> label.

Trait Implementations§

Source§

impl Clone for SnippetActivationMode

Source§

fn clone(&self) -> SnippetActivationMode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SnippetActivationMode

Source§

impl Debug for SnippetActivationMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SnippetActivationMode

Source§

fn default() -> SnippetActivationMode

Returns the “default value” for a type. Read more
Source§

impl Eq for SnippetActivationMode

Source§

impl OptionType for SnippetActivationMode

Source§

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>

Parse the right-hand side of :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

Render the current value back to a string (:set foo? echo, the customize buffer view, value comparison). Round-trips with [Self::parse].
Source§

fn type_label() -> &'static str

Short type label for :describe-option ("boolean", "foldmethod", etc.). Used in help bodies and the customize buffer view.
Source§

fn enumerate() -> Option<Vec<&'static str>>

Optional: enumerate valid string forms for :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>>

Optional: enumerate valid string forms WITH per-value doc strings for the cmdline-completion marginalia column. Default impl wraps [Self::enumerate] with empty docs; types with rich help override. Read more
§

fn name_forms(_canonical: &str) -> Vec<String>

Optional: alternative name forms this type accepts for the option name itself. Used by completion to surface the name alongside its negation (:set nu / :set nonu). Default: no extra forms. Booleans return [format!("no{canonical}")].
§

fn is_bool() -> bool

Whether this type’s option supports :set noFOO. bool returns true; everything else false. Drives the negate path in the cmdline parser.
§

fn accepts_list() -> bool

Whether this option’s value is list-shaped — i.e. a TOML array at config-load time should be joined into the delimited string [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>

Negation value (only meaningful for [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 schema() -> ConfigSchema

The declared shape of this type’s values. Read more
§

fn to_value(&self) -> ConfigValue

This value as a schema-shaped tree. Read more
§

fn from_value(value: &ConfigValue) -> Result<Self, String>

Rebuild from a tree. Default: the inverse of [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

Source§

fn eq(&self, other: &SnippetActivationMode) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SnippetActivationMode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more