#[non_exhaustive]pub struct EcosystemConfig {
pub show_up_to_date_hints: bool,
pub up_to_date_text: String,
pub needs_update_text: String,
pub loading_text: String,
pub show_loading_hints: bool,
pub offline: bool,
}Expand description
Configuration for LSP inlay hints feature.
Since this type is #[non_exhaustive], deps-lsp’s handlers/inlay_hints.rs builds one
via Self::new plus a with_* chain rather than a struct literal — adding a field here
no longer forces that call site to update at compile time. A new field must be wired into
it by hand, or it silently keeps Self::new’s default forever.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.show_up_to_date_hints: boolWhether to show inlay hints for up-to-date dependencies
up_to_date_text: StringText to display for up-to-date dependencies
needs_update_text: StringText to display for dependencies needing updates (use {} for version placeholder)
loading_text: StringText to display while loading registry data
show_loading_hints: boolWhether to show loading hints in inlay hints
offline: boolWhether network.offline is set (issue #483): when true and no cached latest
version exists for a dependency, [crate::lsp_helpers::generate_inlay_hints]
shows an offline marker instead of silently falling back to the resolved-version
display, which would otherwise look identical to a normal pre-fetch state.
Implementations§
Source§impl EcosystemConfig
impl EcosystemConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Builds the default configuration (mirrors Self::default).
Needed because Self is #[non_exhaustive]: a struct literal only works inside
this crate, so every other crate must chain the with_* setters onto this
constructor instead.
§Examples
use deps_core::EcosystemConfig;
let config = EcosystemConfig::new().with_offline(true);
assert!(config.offline);Sourcepub const fn with_show_up_to_date_hints(
self,
show_up_to_date_hints: bool,
) -> Self
pub const fn with_show_up_to_date_hints( self, show_up_to_date_hints: bool, ) -> Self
Overrides Self::show_up_to_date_hints. See Self::new.
Sourcepub fn with_up_to_date_text(self, up_to_date_text: impl Into<String>) -> Self
pub fn with_up_to_date_text(self, up_to_date_text: impl Into<String>) -> Self
Overrides Self::up_to_date_text. See Self::new.
Sourcepub fn with_needs_update_text(
self,
needs_update_text: impl Into<String>,
) -> Self
pub fn with_needs_update_text( self, needs_update_text: impl Into<String>, ) -> Self
Overrides Self::needs_update_text. See Self::new.
Sourcepub fn with_loading_text(self, loading_text: impl Into<String>) -> Self
pub fn with_loading_text(self, loading_text: impl Into<String>) -> Self
Overrides Self::loading_text. See Self::new.
Sourcepub const fn with_show_loading_hints(self, show_loading_hints: bool) -> Self
pub const fn with_show_loading_hints(self, show_loading_hints: bool) -> Self
Overrides Self::show_loading_hints. See Self::new.
Sourcepub const fn with_offline(self, offline: bool) -> Self
pub const fn with_offline(self, offline: bool) -> Self
Overrides Self::offline. See Self::new.