pub trait EcosystemFormatter: Send + Sync {
// Required methods
fn format_version_for_code_action(&self, version: &str) -> String;
fn package_url(&self, name: &str) -> String;
// Provided methods
fn normalize_package_name(&self, name: &str) -> String { ... }
fn version_satisfies_requirement(
&self,
version: &str,
requirement: &str,
) -> bool { ... }
fn yanked_message(&self) -> &'static str { ... }
fn yanked_label(&self) -> &'static str { ... }
fn is_position_on_dependency(
&self,
dep: &dyn Dependency,
position: Position,
) -> bool { ... }
}Expand description
Ecosystem-specific formatting and comparison logic.
Required Methods§
Sourcefn format_version_for_code_action(&self, version: &str) -> String
fn format_version_for_code_action(&self, version: &str) -> String
Format version string for code action text edit.
Sourcefn package_url(&self, name: &str) -> String
fn package_url(&self, name: &str) -> String
Get package URL for hover markdown.
Provided Methods§
Sourcefn normalize_package_name(&self, name: &str) -> String
fn normalize_package_name(&self, name: &str) -> String
Normalize package name for lookup (default: identity).
Sourcefn version_satisfies_requirement(
&self,
version: &str,
requirement: &str,
) -> bool
fn version_satisfies_requirement( &self, version: &str, requirement: &str, ) -> bool
Check if a version satisfies a requirement string.
Sourcefn yanked_message(&self) -> &'static str
fn yanked_message(&self) -> &'static str
Message for yanked/deprecated versions in diagnostics.
Sourcefn yanked_label(&self) -> &'static str
fn yanked_label(&self) -> &'static str
Label for yanked versions in hover.
Sourcefn is_position_on_dependency(
&self,
dep: &dyn Dependency,
position: Position,
) -> bool
fn is_position_on_dependency( &self, dep: &dyn Dependency, position: Position, ) -> bool
Detect if cursor position is on a dependency for code actions.