pub enum FoldMethod {
Manual,
Indent,
Markdown,
Syntax,
Lsp,
}Expand description
One open completion popup (DESIGN.md §5.11.3 vertico-style
rendering). Built by Action::CommandLineCompleteOrAdvance
when the user presses Tab; consumed by accept / dismiss / scroll
actions.
:set foldmethod=... (DESIGN.md §15:18, C.2;
docs/user/folding.md). Decides which provider feeds the
per-buffer fold list.
Each variant’s marginalia doc (right of =>) is what
appears in :set foldmethod=<Tab>. Variant-level ///
docs are for API/rustdoc consumers. Slice
3c.unify.option-docs-builtin migrated this enum to
labeled_enum! — adding a new fold method is now one
line; the label / parse_label / doc / all
accessors are derived automatically.
D.3.f.0 added #[derive(Hash)] so the FoldRegistry
can key its primary-provider map on FoldMethod.
Variants§
Manual
Only user zf ranges, no auto-recompute.
Indent
Universal indent walker.
Markdown
ATX heading nesting (*.md).
Syntax
Tree-sitter scope queries; cascades to Markdown for
.md buffers and Indent otherwise when the tree-
sitter provider has nothing to offer.
Lsp
Feeds from textDocument/foldingRange. Async:
the per-tick pump fires the request when the buffer’s
document version changes; the response lands in a
per-buffer cache and triggers a recompute. Cascades to
Syntax when no attached server advertises the
capability.
Slice: 4.4.f.
Implementations§
Source§impl FoldMethod
impl FoldMethod
Sourcepub fn doc(self) -> &'static str
pub fn doc(self) -> &'static str
Short marginalia doc shown in cmdline-completion’s right-aligned column.
Sourcepub fn all() -> &'static [FoldMethod]
pub fn all() -> &'static [FoldMethod]
Variants in declaration order.
Sourcepub fn parse_label(s: &str) -> Result<FoldMethod, String>
pub fn parse_label(s: &str) -> Result<FoldMethod, String>
Parse from canonical label or any registered alias.
Trait Implementations§
Source§impl Clone for FoldMethod
impl Clone for FoldMethod
Source§fn clone(&self) -> FoldMethod
fn clone(&self) -> FoldMethod
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 FoldMethod
Source§impl Debug for FoldMethod
impl Debug for FoldMethod
Source§impl Default for FoldMethod
impl Default for FoldMethod
Source§fn default() -> FoldMethod
fn default() -> FoldMethod
impl Eq for FoldMethod
Source§impl Hash for FoldMethod
impl Hash for FoldMethod
Source§impl OptionType for FoldMethod
impl OptionType for FoldMethod
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<FoldMethod, String>
fn parse(s: &str) -> Result<FoldMethod, 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.Source§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 moreSource§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}")].Source§fn is_bool() -> bool
fn is_bool() -> bool
:set noFOO. bool
returns true; everything else false. Drives the negate
path in the cmdline parser.Source§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.Source§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).Source§fn schema() -> ConfigSchema
fn schema() -> ConfigSchema
Source§fn to_value(&self) -> ConfigValue
fn to_value(&self) -> ConfigValue
Source§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 FoldMethod
impl PartialEq for FoldMethod
impl StructuralPartialEq for FoldMethod
Auto Trait Implementations§
impl Freeze for FoldMethod
impl RefUnwindSafe for FoldMethod
impl Send for FoldMethod
impl Sync for FoldMethod
impl Unpin for FoldMethod
impl UnsafeUnpin for FoldMethod
impl UnwindSafe for FoldMethod
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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.§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more