pub struct GradleFormatter;Trait Implementations§
Source§impl DiagnosticMessages for GradleFormatter
impl DiagnosticMessages for GradleFormatter
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 GradleFormatter
impl DiagnosticPolicy for GradleFormatter
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 GradleFormatter
impl OsvNaming for GradleFormatter
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 GradleFormatter
impl PackageNaming for GradleFormatter
Source§fn validate_package_name(&self, name: &str) -> Result<(), InvalidPackageName>
fn validate_package_name(&self, name: &str) -> Result<(), InvalidPackageName>
Validates a Gradle coordinate’s group:artifact shape and character set.
Gradle resolves through deps_maven::MavenCentralRegistry and shares Maven’s
groupId:artifactId coordinate shape (see deps-gradle/src/ecosystem.rs), so this
mirrors deps_maven’s MavenFormatter::validate_package_name exactly, reusing
is_safe_maven_coordinate_segment rather than duplicating it — letting the
“Invalid package name” diagnostic surface the accurate reason instead of the
generic “Unknown package” a registry-side rejection produces (#375).
Unlike Maven’s ${property}-specific is_unresolved, this uses Gradle’s own
is_unresolved, which also short-circuits on an unresolved $var/${var}
reference or Gradle-catalog-alias placeholder — valid Gradle syntax, not a
malformed coordinate.
§Errors
Returns InvalidPackageName if name has no : separator, or if either the
group or artifact segment fails is_safe_maven_coordinate_segment — but
never when name is unresolved per is_unresolved, which is accepted instead.
Source§fn normalize_package_name(&self, name: &PackageName) -> String
fn normalize_package_name(&self, name: &PackageName) -> String
Source§impl PackageRendering for GradleFormatter
impl PackageRendering for GradleFormatter
Source§fn format_version_replacing(
&self,
version: &ConcreteVersion,
current: &str,
) -> String
fn format_version_replacing( &self, version: &ConcreteVersion, current: &str, ) -> String
Preserves Gradle’s rich-version strict/preferred shorthand
({strictlyVersion}!!{preferredVersion}) when current carries it — a bare
format_version_for_text_edit replacement would otherwise silently downgrade
a strict constraint to a normal one.
Only the degenerate suffix form (1.2.3!!, no preferredVersion) is
rewritten — to {version}!! — since the strict pin itself is what “update
version” means to bump there, and there is nothing else in the requirement to
preserve. The full infix form ([1.7,1.8[!!1.7.25) is left unchanged rather
than rewriting the preferredVersion half: since Gradle’s strict constraint
always wins conflict resolution, bumping the preference to a version outside
the hand-written strict range (a likely outcome for “update to latest”) would
silently write a no-op edit that looks like an update but changes nothing —
worse than the original silently-dropped-marker bug, since the manifest now
reads as though it were updated. There is no single rewrite that is safe in
general without inspecting the strict range’s bounds, which is out of scope
here. current is trimmed before the marker check for the same
un-trimmed-catalog-value reason as strip_strict_marker above. A no-op
return here is safely excluded from deps-core’s collect_update_all_edits
(“Update N outdated dependencies” lens) by its own no-op guard.
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_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 suppress_package_url(&self, source: &DependencySource) -> bool
fn suppress_package_url(&self, source: &DependencySource) -> bool
Self::package_url’s heading link for a dependency
resolved against source. 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 GradleFormatter
impl RequirementResolution for GradleFormatter
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 malformed range (leading [/(/] but
crate::range::parse_range fails) — checked unconditionally, first, before any
other branch: without this guard ahead of the AlwaysSatisfied/dynamic-prefix
short-circuits below, a malformed bracket range that also happens to end in +
(e.g. "[1.0,2.0]+") would be misclassified as a dynamic prefix — which decides
Some(false) for every real candidate — instead of correctly suppressing the check.
#249 review (M4): this is a separate branch-order copy from gradle_version_matches
above — see the note on that function before reordering either one.
Source§fn version_satisfies_requirement(
&self,
version: &ConcreteVersion,
requirement: &str,
) -> bool
fn version_satisfies_requirement( &self, version: &ConcreteVersion, requirement: &str, ) -> bool
Source§fn requirement_is_unresolved(&self, requirement: &VersionReq) -> bool
fn requirement_is_unresolved(&self, requirement: &VersionReq) -> bool
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 moreSource§fn is_requirement_up_to_date(
&self,
requirement: &VersionReq,
latest: &ConcreteVersion,
) -> bool
fn is_requirement_up_to_date( &self, requirement: &VersionReq, latest: &ConcreteVersion, ) -> bool
latest, given its declared requirement. Read moreSource§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 GradleFormatter
impl SourcePolicy for GradleFormatter
Source§fn can_resolve_source(&self, source: &DependencySource) -> bool
fn can_resolve_source(&self, source: &DependencySource) -> bool
source. Read moreSource§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 GradleFormatter
impl RefUnwindSafe for GradleFormatter
impl Send for GradleFormatter
impl Sync for GradleFormatter
impl Unpin for GradleFormatter
impl UnsafeUnpin for GradleFormatter
impl UnwindSafe for GradleFormatter
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