Skip to main content

DenoFormatter

Struct DenoFormatter 

Source
pub struct DenoFormatter;
Expand description

EcosystemFormatter for Deno manifests (D4).

Trait Implementations§

Source§

impl DiagnosticMessages for DenoFormatter

Source§

fn yanked_message(&self) -> &'static str

S2: adopts deps-npm’s wording for the whole formatter (both jsr: and npm: specifiers), rather than the deps-core defaults (“yanked”). Spec.md US-002/ FR-013 treat cross-ecosystem wording divergence for the same npm package as a first-class bug, and EcosystemFormatter::yanked_message/yanked_label take only &self (no &dyn Dependency), so a per-scheme override is not possible without a deps-core trait change — this is the zero-cost fix available today.

Source§

fn yanked_label(&self) -> &'static str

Label for yanked versions in hover.
Source§

fn deprecated_message(&self) -> &'static str

Message for a package-level deprecation/abandonment diagnostic (issue #205). Read more
Source§

fn deprecated_label(&self) -> &'static str

Label for a deprecated package in hover.
Source§

impl DiagnosticPolicy for DenoFormatter

Source§

fn yanked_diagnostic_applies_to( &self, dep: &dyn Dependency, _requirement: &VersionReq, ) -> bool

Scheme-aware (#448, fixing the #436 M1 divergence): for npm: specifiers, returns false unconditionally, mirroring NpmFormatter::yanked_diagnostic_applies_to’s post-#436 behavior — an exact-pin npm: dependency in deno.json (e.g. npm:lodash@4.17.20) no longer surfaces this diagnostic, consistent with the equivalent exact-pin package.json dependency.

For jsr: specifiers, applies unconditionally (true), matching the trait default that Cargo/PyPI/Dart already rely on (#454, dropping the exact-pin-only restriction this hook carried before #448 made it scheme-aware). Unlike npm’s deprecated — which #436 found routinely applied to every published version at once, making this diagnostic redundant with the package-level deprecation diagnostic (#205) — JSR’s yanked flag has no package-level counterpart to conflate with: JsrVersion’s impl_version! invocation leaves deprecation unset, so Version::deprecation() is structurally None for every JSR version and #205 never fires for jsr: dependencies. There is also no data gap: JSR’s meta.json (JsrRegistry::get_versions) returns every version’s yanked flag in one fetch, identical whether the manifest requirement is a range or an exact pin.

Source§

fn strict_semver_prerelease_exclusion(&self) -> bool

Whether this ecosystem’s requirement/version syntax follows strict SemVer 2.0.0 pre-release semantics: a pre-release version (X.Y.Z-pre) is excluded from matching requirement unless requirement itself pins to the same X.Y.Z tuple with a pre-release tag — the rule Cargo’s semver crate and npm’s node-semver both implement, and that compile_requirement’s matcher inherits from its underlying comparator. Read more
Source§

fn supports_package_rename(&self) -> bool

Whether this ecosystem’s deprecation payload (crate::Deprecation::replacement) is safe to offer as a “Replace with X” rename quickfix. Read more
Source§

impl OsvNaming for DenoFormatter

Source§

fn osv_package_name(&self, dep: &dyn Dependency) -> Option<String>

npm: dependencies map to OSV’s npm ecosystem via their bare name (D5); jsr: dependencies return None — OSV has no JSR ecosystem (live-verified: POST api.osv.dev/v1/query with {"ecosystem":"JSR"} returns code 3, invalid ecosystem) — which cleanly skips them from the scan rather than risking a cross-registry name collision.

Source§

fn osv_version_to_native(&self, version: &str) -> String

Converts a version string as it appears in an OSV advisory record (e.g. crate::osv::Advisory::fixed_versions) into this ecosystem’s own version namespace, as used in manifests and by the registry. Read more
Source§

fn osv_version(&self, version: &str) -> String

Rewrites a native-ecosystem version string into the spelling OSV.dev’s SEMVER range matching expects. Read more
Source§

impl PackageNaming for DenoFormatter

Source§

fn validate_package_name(&self, name: &str) -> Result<(), InvalidPackageName>

Validates the scheme-qualified name: jsr: requires the scoped @scope/name form (mirroring JSR’s own registration rules); npm: delegates to npm’s own validator on the bare name (ECOSYSTEM_GUIDE.md “npm Package Name Validation”); any other/missing scheme is rejected outright.

Source§

fn normalize_package_name(&self, name: &PackageName) -> String

Normalize package name for lookup (default: identity).
Source§

impl PackageRendering for DenoFormatter

Source§

fn format_version_for_text_edit(&self, version: &ConcreteVersion) -> String

Format version string for code action text edit.
Source§

fn package_url(&self, name: &PackageName) -> String

Get package URL for hover markdown.
Source§

fn format_version_replacing( &self, version: &ConcreteVersion, _current: &str, ) -> String

Format version as a replacement for the existing requirement text current, preserving current’s operator/pin style where the ecosystem supports more than one. Read more
Source§

fn format_version_replacing_for( &self, _dep: &dyn Dependency, version: &ConcreteVersion, current: &str, ) -> String

Like format_version_replacing, but also carries the dependency identity version/current apply to. Read more
Source§

fn suppress_package_url(&self, source: &DependencySource) -> bool

Whether hover should omit Self::package_url’s heading link for a dependency resolved against source. Read more
Source§

fn is_position_on_dependency( &self, dep: &dyn Dependency, position: Position, ) -> bool

Detect if cursor position is on a dependency for code actions.
Source§

impl RequirementResolution for DenoFormatter

Source§

fn compile_requirement( &self, requirement: &VersionReq, ) -> Option<Box<dyn RequirementMatcher>>

Compiles requirement via node_semver::Range, the same crate deps-npm uses — correct for JSR too, since JSR mandates semver.

Source§

fn version_satisfies_requirement( &self, version: &ConcreteVersion, requirement: &str, ) -> bool

Check if a version satisfies a requirement string. Read more
Source§

fn is_requirement_up_to_date( &self, requirement: &VersionReq, latest: &ConcreteVersion, ) -> bool

Whether an unresolved dependency (no lock-file version) should be reported as up to date against latest, given its declared requirement. Read more
Source§

fn requirement_is_unresolved(&self, _requirement: &VersionReq) -> bool

Whether requirement could not be resolved to a concrete version constraint (e.g. an unexpanded property/variable placeholder rather than a real version or range). Read more
Source§

fn requirement_status( &self, requirement: &VersionReq, latest: &ConcreteVersion, ) -> RequirementStatus

Tri-state variant of is_requirement_up_to_date that distinguishes “confirmed up to date” from “could not be resolved, so we don’t know.” Read more
Source§

fn requirement_status_for( &self, dep: &dyn Dependency, requirement: &VersionReq, latest: &ConcreteVersion, ) -> RequirementStatus

Like requirement_status, but also hands the ecosystem the dependency itself — for an ecosystem whose requirement text alone is ambiguous between two shapes with different resolution rules, and which already computed the disambiguating classification once, at parse time, onto the dependency (deps-gitlab-ci’s PinStyle, #466 review M-c: a bare "1.2" is Partial under its component: pin grammar but Branch under its simpler project: ref grammar — indistinguishable from the text alone). Read more
Source§

fn requirement_is_undecidable_given_available( &self, _requirement: &VersionReq, _available: &[ConcreteVersion], ) -> bool

Whether this ecosystem’s registry can silently omit a published version from available in a way indistinguishable from “never published” — and, if so, whether requirement names a version-space region that specific omission could explain, given the versions actually observed in available. Read more
Source§

fn manifest_requirement_is_resolved_version(&self, dep: &dyn Dependency) -> bool

Whether dep’s manifest version-requirement line is itself the exact version already selected — never a range. Read more
Source§

impl SourcePolicy for DenoFormatter

Source§

fn can_resolve_source(&self, source: &DependencySource) -> bool

Whether this ecosystem’s registry can resolve version data for source. Read more
Source§

fn source_is_public_registry_content(&self, source: &DependencySource) -> bool

Whether source’s content is exactly the default public registry’s — safe to treat as such for OSV vulnerability scanning, cache-key signature construction, and hover heading links. Read more

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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