pub struct NuGetFormatter;Trait Implementations§
Source§impl DiagnosticMessages for NuGetFormatter
impl DiagnosticMessages for NuGetFormatter
Source§fn yanked_message(&self) -> &'static str
fn yanked_message(&self) -> &'static str
Source§fn yanked_label(&self) -> &'static str
fn yanked_label(&self) -> &'static str
Source§fn deprecated_message(&self) -> &'static str
fn deprecated_message(&self) -> &'static str
Source§fn deprecated_label(&self) -> &'static str
fn deprecated_label(&self) -> &'static str
Source§impl DiagnosticPolicy for NuGetFormatter
impl DiagnosticPolicy for NuGetFormatter
Source§fn strict_semver_prerelease_exclusion(&self) -> bool
fn strict_semver_prerelease_exclusion(&self) -> bool
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 moreSource§fn supports_package_rename(&self) -> bool
fn supports_package_rename(&self) -> bool
crate::Deprecation::replacement)
is safe to offer as a “Replace with X” rename quickfix. Read moreSource§fn yanked_diagnostic_applies_to(
&self,
_dep: &dyn Dependency,
_requirement: &VersionReq,
) -> bool
fn yanked_diagnostic_applies_to( &self, _dep: &dyn Dependency, _requirement: &VersionReq, ) -> bool
crate::lsp_helpers::requirement_matches_only_yanked) should evaluate requirement
at all for this ecosystem. Read moreSource§impl OsvNaming for NuGetFormatter
impl OsvNaming for NuGetFormatter
Source§fn osv_package_name(&self, dep: &dyn Dependency) -> Option<String>
fn osv_package_name(&self, dep: &dyn Dependency) -> Option<String>
dep’s package name, or None if
this dependency cannot be mapped (e.g. a non-GitHub Swift package). Read moreSource§fn osv_version_to_native(&self, version: &str) -> String
fn osv_version_to_native(&self, version: &str) -> String
crate::osv::Advisory::fixed_versions) into this ecosystem’s
own version namespace, as used in manifests and by the registry. Read moreSource§impl PackageNaming for NuGetFormatter
impl PackageNaming for NuGetFormatter
Source§fn validate_package_name(&self, name: &str) -> Result<(), InvalidPackageName>
fn validate_package_name(&self, name: &str) -> Result<(), InvalidPackageName>
Lints name against NuGet’s own PackageIdValidator rule (see
is_valid_nuget_id), so a structurally invalid package ID is reported as “Invalid
package name” instead of falling through to a registry lookup and rendering the
generic “Registry lookup failed” diagnostic (#402).
An unresolved MSBuild property reference (e.g. <PackageReference Include="$(MyPackageId)" />) is checked first and always accepted — the same
unresolvable-variable treatment requirement_is_unresolved already gives a
$(...)-containing version string (#402 critique M2): name here is not a
concrete package id at all until MSBuild expands the property, so it has no shape to
validate.
§Errors
Returns InvalidPackageName if name is empty, exceeds 100 characters, or contains
a character outside NuGet’s \w+([_.-]\w+)* shape.
Source§fn normalize_package_name(&self, name: &PackageName) -> String
fn normalize_package_name(&self, name: &PackageName) -> String
NuGet package ids are case-insensitive and every V3 API path segment is lowercased.
Source§impl PackageRendering for NuGetFormatter
impl PackageRendering for NuGetFormatter
Source§fn suppress_package_url(&self, source: &DependencySource) -> bool
fn suppress_package_url(&self, source: &DependencySource) -> bool
FR-011 (issue #523, M1): an AlternateRegistry dependency (resolved against a private
NuGet.Config-declared feed) must not render nuget.org’s package-page link alongside
live private-feed data — a nuget.org link next to that would read as confirmation the
link is real, which is worse than showing no link at all. Delegates to
SourcePolicy::source_is_public_registry_content, which is true only for plain
Registry (the default) — so this suppresses the link for exactly the sources
Self::can_resolve_source newly opts into resolving.
Source§fn format_version_for_text_edit(&self, version: &ConcreteVersion) -> String
fn format_version_for_text_edit(&self, version: &ConcreteVersion) -> String
Source§fn package_url(&self, name: &PackageName) -> String
fn package_url(&self, name: &PackageName) -> String
Source§fn format_version_replacing(
&self,
version: &ConcreteVersion,
_current: &str,
) -> String
fn format_version_replacing( &self, version: &ConcreteVersion, _current: &str, ) -> String
version as a replacement for the existing requirement text
current, preserving current’s operator/pin style where the
ecosystem supports more than one. Read moreSource§fn format_version_replacing_for(
&self,
_dep: &dyn Dependency,
version: &ConcreteVersion,
current: &str,
) -> String
fn format_version_replacing_for( &self, _dep: &dyn Dependency, version: &ConcreteVersion, current: &str, ) -> String
format_version_replacing, but also
carries the dependency identity version/current apply to. Read moreSource§fn is_position_on_dependency(
&self,
dep: &dyn Dependency,
position: Position,
) -> bool
fn is_position_on_dependency( &self, dep: &dyn Dependency, position: Position, ) -> bool
Source§impl RequirementResolution for NuGetFormatter
impl RequirementResolution for NuGetFormatter
Source§fn version_satisfies_requirement(
&self,
version: &ConcreteVersion,
requirement: &str,
) -> bool
fn version_satisfies_requirement( &self, version: &ConcreteVersion, requirement: &str, ) -> bool
Overridden because the default npm caret/tilde semantics do not apply to NuGet’s
interval-notation ranges ([1.0,2.0)) and floating patterns (1.1.*).
Source§fn is_requirement_up_to_date(
&self,
requirement: &VersionReq,
latest: &ConcreteVersion,
) -> bool
fn is_requirement_up_to_date( &self, requirement: &VersionReq, latest: &ConcreteVersion, ) -> bool
Overridden because a minimum-only range (a bare Version="1.0.0", or its explicit
open-ended-minimum spellings [1.0.0,)/(1.0.0,)/[1.0.0,]) is a floor under
PackageReference/PackageVersion semantics, not an auto-following range:
version_satisfies_requirement accepts any version >= 1.0.0, so delegating to it
here would never flag a floor as outdated. latest behind the floor is not
“outdated” either (it would read as a downgrade suggestion), so up to date is
latest <= floor here, not latest == floor. Exact pins, maximums, bounded ranges,
and floating patterns (1.1.*) already express the intended forward-compatibility
window, so those keep the general satisfies check.
Source§fn requirement_is_unresolved(&self, requirement: &VersionReq) -> bool
fn requirement_is_unresolved(&self, requirement: &VersionReq) -> bool
M3: an unexpanded MSBuild property reference ($(PropertyName)) inside a version
string — most commonly [$(MinVersion),$(MaxVersion)), which parses to a Bounded
interval whose min/max both fall back to 0.0.0 (a fail-safe floor, not an error),
but then rejects every real candidate as out of range. A bare $(X) (unbracketed) is
already fail-safe via that same floor fallback and needs no guard; the bracketed form
does not. Mirrors Maven’s ${property} / Gradle’s $var/${var} unresolved-variable
guards.
Source§fn compile_requirement(
&self,
requirement: &VersionReq,
) -> Option<Box<dyn RequirementMatcher>>
fn compile_requirement( &self, requirement: &VersionReq, ) -> Option<Box<dyn RequirementMatcher>>
Uses compile_requirement_unless (see that function and
deps_core::lsp_helpers::RequirementResolution::compile_requirement for the shared “undecidable” contract).
The undecidable predicate rejects a syntactically malformed range or floating pattern
(parsing fails) — without this guard, a malformed requirement string would make
satisfies/resolve_float return false for every candidate, producing a false
“unsatisfiable” verdict instead of correctly suppressing the check.
Source§fn requirement_status(
&self,
requirement: &VersionReq,
latest: &ConcreteVersion,
) -> RequirementStatus
fn requirement_status( &self, requirement: &VersionReq, latest: &ConcreteVersion, ) -> RequirementStatus
is_requirement_up_to_date that distinguishes “confirmed up to
date” from “could not be resolved, so we don’t know.” Read moreSource§fn requirement_status_for(
&self,
dep: &dyn Dependency,
requirement: &VersionReq,
latest: &ConcreteVersion,
) -> RequirementStatus
fn requirement_status_for( &self, dep: &dyn Dependency, requirement: &VersionReq, latest: &ConcreteVersion, ) -> RequirementStatus
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 moreSource§fn requirement_is_undecidable_given_available(
&self,
_requirement: &VersionReq,
_available: &[ConcreteVersion],
) -> bool
fn requirement_is_undecidable_given_available( &self, _requirement: &VersionReq, _available: &[ConcreteVersion], ) -> bool
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 moreSource§fn manifest_requirement_is_resolved_version(&self, dep: &dyn Dependency) -> bool
fn manifest_requirement_is_resolved_version(&self, dep: &dyn Dependency) -> bool
dep’s manifest version-requirement line is itself the exact
version already selected — never a range. Read moreSource§impl SourcePolicy for NuGetFormatter
impl SourcePolicy for NuGetFormatter
Source§fn can_resolve_source(&self, source: &DependencySource) -> bool
fn can_resolve_source(&self, source: &DependencySource) -> bool
FR-011 (issue #523): a NuGet dependency resolved against a private NuGet.Config
feed is version-resolvable through NuGetRegistry’s alternate-feed chain, not just
the default Registry/AlternateRegistry-excluding set
deps_core::parser::DependencySource::is_version_resolvable would otherwise answer.
source_is_public_registry_content stays at its default (Registry only) — an
AlternateRegistry dependency is resolvable but is never treated as public-registry
content for OSV/deps.dev/hover-trust-signal purposes (M3: deliberate privacy
protection, since those signals would otherwise send a private package’s name to a
public service by default).
Source§fn source_is_public_registry_content(&self, source: &DependencySource) -> bool
fn source_is_public_registry_content(&self, source: &DependencySource) -> bool
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 moreAuto Trait Implementations§
impl Freeze for NuGetFormatter
impl RefUnwindSafe for NuGetFormatter
impl Send for NuGetFormatter
impl Sync for NuGetFormatter
impl Unpin for NuGetFormatter
impl UnsafeUnpin for NuGetFormatter
impl UnwindSafe for NuGetFormatter
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> EcosystemFormatter for Twhere
T: PackageNaming + PackageRendering + RequirementResolution + DiagnosticMessages + DiagnosticPolicy + SourcePolicy + OsvNaming,
§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