pub struct DepsConfig {
pub inlay_hints: InlayHintsConfig,
pub diagnostics: DiagnosticsConfig,
pub cache: CacheConfig,
pub cold_start: ColdStartConfig,
pub loading_indicator: LoadingIndicatorConfig,
pub code_lens: CodeLensConfig,
pub freshness: FreshnessConfig,
pub supply_chain: SupplyChainConfig,
pub registries: RegistriesConfig,
pub network: NetworkConfig,
}Expand description
Root configuration for the deps-lsp server.
This configuration can be provided by the LSP client via initialization options or workspace settings. All fields use sensible defaults if not specified.
§Examples
use deps_lsp::config::DepsConfig;
let json = r#"{
"inlay_hints": {
"enabled": true,
"up_to_date_text": "✅",
"needs_update_text": "❌ {}"
}
}"#;
let config: DepsConfig = serde_json::from_str(json).unwrap();
assert!(config.inlay_hints.enabled);deny_unknown_fields on this top-level struct only (never on the section structs
below, to preserve forward-compat for keys added inside a known section): any key that
isn’t one of DepsConfig’s own fields makes the whole payload fail to parse, so
parse_config (server.rs) can react by keeping the previous configuration rather
than silently substituting an all-defaults one. Without this, a single recognized key
in an otherwise-unrelated blob (e.g. a client that flattens its whole settings tree)
would deserialize successfully and reset every unrecognized section to its default —
issue #227 C2.
Fields§
§inlay_hints: InlayHintsConfig§diagnostics: DiagnosticsConfig§cache: CacheConfig§cold_start: ColdStartConfig§loading_indicator: LoadingIndicatorConfig§code_lens: CodeLensConfig§freshness: FreshnessConfig§supply_chain: SupplyChainConfig§registries: RegistriesConfig§network: NetworkConfigTrait Implementations§
Source§impl Debug for DepsConfig
impl Debug for DepsConfig
Source§impl Default for DepsConfig
impl Default for DepsConfig
Source§fn default() -> DepsConfig
fn default() -> DepsConfig
Source§impl<'de> Deserialize<'de> for DepsConfig
impl<'de> Deserialize<'de> for DepsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DepsConfig
impl RefUnwindSafe for DepsConfig
impl Send for DepsConfig
impl Sync for DepsConfig
impl Unpin for DepsConfig
impl UnsafeUnpin for DepsConfig
impl UnwindSafe for DepsConfig
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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