pub enum DiagnosticsSeverity {
Error,
Warning,
Info,
Hint,
}Expand description
ui.diagnostics.inline-min-severity — the least-severe level a
diagnostic must be to appear in the inline summary. A diagnostic is
included when its severity is as severe or more severe than this
(i.e. its rank ≤ this rank).
Variants§
Error
Errors only (rank 0).
Warning
Warnings and errors (rank 1).
Info
Info, warnings and errors (rank 2).
Hint
The default: include everything down to hints.
Implementations§
Source§impl DiagnosticsSeverity
impl DiagnosticsSeverity
Sourcepub fn rank(&self) -> u8
pub fn rank(&self) -> u8
Severity rank matching lattice_lsp::diagnostics_layer’s
severity_rank (Error = 0 … Hint = 3) — lower is more severe.
The host includes a diagnostic when its rank ≤ this rank.
Sourcepub fn label(&self) -> &'static str
pub fn label(&self) -> &'static str
The on-disk / :set spelling: error, warning, info or
hint. The inverse of Self::parse_label.
Sourcepub fn doc(&self) -> &'static str
pub fn doc(&self) -> &'static str
One-line description of this threshold for the :set value
completion marginalia.
Sourcepub fn all() -> [DiagnosticsSeverity; 4]
pub fn all() -> [DiagnosticsSeverity; 4]
Every value, most severe first (the closed value set).
Sourcepub fn parse_label(s: &str) -> Result<Self, String>
pub fn parse_label(s: &str) -> Result<Self, String>
Parse a Self::label back into a value. Exact match; any
other input is an Err naming the accepted forms.
§Examples
use lattice_config::DiagnosticsSeverity;
let min = DiagnosticsSeverity::parse_label("warning").unwrap();
// A diagnostic is shown when its rank is <= the threshold's rank.
assert!(DiagnosticsSeverity::Error.rank() <= min.rank());
assert!(DiagnosticsSeverity::Hint.rank() > min.rank());Trait Implementations§
Source§impl Clone for DiagnosticsSeverity
impl Clone for DiagnosticsSeverity
Source§fn clone(&self) -> DiagnosticsSeverity
fn clone(&self) -> DiagnosticsSeverity
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 DiagnosticsSeverity
Source§impl Debug for DiagnosticsSeverity
impl Debug for DiagnosticsSeverity
Source§impl Default for DiagnosticsSeverity
impl Default for DiagnosticsSeverity
Source§fn default() -> DiagnosticsSeverity
fn default() -> DiagnosticsSeverity
impl Eq for DiagnosticsSeverity
Source§impl OptionType for DiagnosticsSeverity
impl OptionType for DiagnosticsSeverity
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.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 DiagnosticsSeverity
impl PartialEq for DiagnosticsSeverity
impl StructuralPartialEq for DiagnosticsSeverity
Auto Trait Implementations§
impl Freeze for DiagnosticsSeverity
impl RefUnwindSafe for DiagnosticsSeverity
impl Send for DiagnosticsSeverity
impl Sync for DiagnosticsSeverity
impl Unpin for DiagnosticsSeverity
impl UnsafeUnpin for DiagnosticsSeverity
impl UnwindSafe for DiagnosticsSeverity
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.