Skip to main content

ConfigError

Enum ConfigError 

Source
#[non_exhaustive]
pub enum ConfigError { UnsupportedFilePattern { server: ServerId, pattern: UnsupportedFilePattern, }, NotUtf8(FromUtf8Error), FileTooLarge(SizeExceeded), DuplicateEnvKey { server: ServerId, error: DuplicateEnvKey, }, NoParentDirectory { path: PathBuf, }, SelectionAutoOnNonTypescript { language: LanguageId, }, UnknownAllowedServer { server: ServerId, configured: Vec<ServerId>, }, DuplicateServerId { id: ServerId, first: Box<EntrySummary>, second: Box<EntrySummary>, }, TwoCatchAllServers { language: LanguageId, existing: ServerId, id: ServerId, }, ToolClaimedTwice { tool: ToolKind, language: LanguageId, existing: ServerId, id: ServerId, }, UnresolvableWorkspaceRoot { written: PathBuf, base_dir: PathBuf, probe: PathBuf, source: Error, }, }
Expand description

A configuration value that is invalid in the context of the entry that holds it.

Field-level rules live in the types of the fields (a rejected value cannot be built); this enum carries what only the surrounding entry or the whole configuration can add, such as which server a bad value belongs to.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

UnsupportedFilePattern

A server entry lists a file_patterns form that maps to no extension.

Fields

§server: ServerId

The id of the entry that holds the pattern.

§pattern: UnsupportedFilePattern

The rejected pattern and the supported forms.

§

NotUtf8(FromUtf8Error)

The config file’s bytes are not UTF-8.

§

FileTooLarge(SizeExceeded)

The config file is over its fixed size limit, which is not configurable.

§

DuplicateEnvKey

A server’s env table sets one variable twice, which the host treats as one name.

Fields

§server: ServerId

The id of the entry that holds the table.

§error: DuplicateEnvKey

The colliding keys.

§

NoParentDirectory

A config path has no directory to resolve relative entries against.

Fields

§path: PathBuf

The config path.

§

SelectionAutoOnNonTypescript

selection = "auto" on an entry that is not typescript-language-server.

Fields

§language: LanguageId

The language of the offending entry.

§

UnknownAllowedServer

An allowed server id names no configured server.

Fields

§server: ServerId

The allowed id that matches nothing.

§configured: Vec<ServerId>

The ids of the configured servers.

§

DuplicateServerId

Two applicable entries share one server id.

Fields

§id: ServerId

The shared id.

§first: Box<EntrySummary>

The first entry.

§second: Box<EntrySummary>

The second entry.

§

TwoCatchAllServers

A language has two servers that both omit handles.

Fields

§language: LanguageId

The language both serve.

§existing: ServerId

The server registered first.

§id: ServerId

The server that collides with it.

§

ToolClaimedTwice

Two servers of one language claim the same tool in handles.

Fields

§tool: ToolKind

The contested tool.

§language: LanguageId

The language both serve.

§existing: ServerId

The server registered first.

§id: ServerId

The server that collides with it.

§

UnresolvableWorkspaceRoot

A configured workspace root cannot be canonicalized.

Fields

§written: PathBuf

The root as written in the config.

§base_dir: PathBuf

The directory a relative root is resolved against.

§probe: PathBuf

The path that was canonicalized.

§source: Error

Why canonicalization failed.

Trait Implementations§

Source§

impl Debug for ConfigError

Source§

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

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

impl Display for ConfigError

Source§

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

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

impl Error for ConfigError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ConfigError> for Error

Source§

fn from(source: ConfigError) -> Self

Converts to this type from the input type.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<T> WithSubscriber for T

Source§

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

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

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