pub enum LanguageRegistrationError {
ShadowsBuiltin {
name: String,
},
AlreadyRegistered {
name: String,
},
NoExtensions {
name: String,
},
QueryCompile {
name: String,
detail: String,
},
}Expand description
Why a registration was refused. Every variant names the offending language, because a plugin author reading a log line needs to know which of their contributions failed — and per LG.3’s error rule a failed language must not take the plugin’s other contributions with it.
Variants§
ShadowsBuiltin
The name collides with a language compiled into the editor.
Refused rather than shadowed: a plugin silently replacing rust
would be a confusing failure to debug, and deliberate override
is a separate question nobody has asked for yet.
AlreadyRegistered
Another plugin already registered this name.
NoExtensions
A language with no extensions can never be selected, so it is almost certainly a mistake in the manifest rather than an intentional registration.
QueryCompile
One of the language’s tree-sitter queries did not compile.
Queries compile at REGISTRATION, not first use, so this surfaces
at load with the offending query named. The alternative — compile
lazily — turns a typo in folds.scm into “folding silently does
nothing in org files”, which is indistinguishable from the
feature not existing and surfaces days later.
Trait Implementations§
Source§impl Clone for LanguageRegistrationError
impl Clone for LanguageRegistrationError
Source§fn clone(&self) -> LanguageRegistrationError
fn clone(&self) -> LanguageRegistrationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LanguageRegistrationError
impl Debug for LanguageRegistrationError
Source§impl Display for LanguageRegistrationError
impl Display for LanguageRegistrationError
impl Eq for LanguageRegistrationError
Source§impl Error for LanguageRegistrationError
impl Error for LanguageRegistrationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for LanguageRegistrationError
Auto Trait Implementations§
impl Freeze for LanguageRegistrationError
impl RefUnwindSafe for LanguageRegistrationError
impl Send for LanguageRegistrationError
impl Sync for LanguageRegistrationError
impl Unpin for LanguageRegistrationError
impl UnsafeUnpin for LanguageRegistrationError
impl UnwindSafe for LanguageRegistrationError
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.§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