pub struct GitlabCiFormatter { /* private fields */ }Expand description
Formatter for GitLab CI ecosystem LSP responses.
Implementations§
Source§impl GitlabCiFormatter
impl GitlabCiFormatter
Sourcepub fn new(
routes: Arc<DashMap<String, GitlabRoute>>,
tag_index: Arc<DashMap<PackageName, Arc<TagIndex>>>,
) -> GitlabCiFormatter
pub fn new( routes: Arc<DashMap<String, GitlabRoute>>, tag_index: Arc<DashMap<PackageName, Arc<TagIndex>>>, ) -> GitlabCiFormatter
Creates a new formatter over the given shared registry handles.
Trait Implementations§
Source§impl DiagnosticMessages for GitlabCiFormatter
impl DiagnosticMessages for GitlabCiFormatter
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 GitlabCiFormatter
impl DiagnosticPolicy for GitlabCiFormatter
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 GitlabCiFormatter
impl OsvNaming for GitlabCiFormatter
Source§fn osv_version(&self, version: &str) -> String
fn osv_version(&self, version: &str) -> String
Unprefixed — mirrors deps-github-actions’s identical rationale, kept for
cross-ecosystem consistency even though it is largely unreachable here (a git-tag
pin has no OSV coordinate by name).
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 GitlabCiFormatter
impl PackageNaming for GitlabCiFormatter
Source§fn validate_package_name(&self, name: &str) -> Result<(), InvalidPackageName>
fn validate_package_name(&self, name: &str) -> Result<(), InvalidPackageName>
Accepts both the bare (org/proj[/comp]) and host-qualified
(host/org/proj[/comp]) coordinate shapes — is_valid_gitlab_coordinate is a
syntactic gate only, not a semantic classifier (see that function’s doc).
Source§fn normalize_package_name(&self, name: &PackageName) -> String
fn normalize_package_name(&self, name: &PackageName) -> String
Source§impl PackageRendering for GitlabCiFormatter
impl PackageRendering for GitlabCiFormatter
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
Preserves current’s v-prefix style for a normal (Sha/Tag/Branch/unpinned)
update; Partial/Latest pins are returned unchanged — bumping 1.2 to 1.3.0
changes the pin’s kind, not just its value, so the shared no-op guard correctly
suppresses the code action instead of writing a value-changing-but-kind-wrong edit.
Source§fn suppress_package_url(&self, source: &DependencySource) -> bool
fn suppress_package_url(&self, source: &DependencySource) -> bool
component: includes only (spec §8.2/NFR-004 carve-out) — a component’s name ends
in the component segment, so https://{name} is not the project’s URL; the real
project link is spliced into the hover body instead (crate::ecosystem’s
generate_hover override). A project: include’s name is exactly
{host}/{project_path}, so its standard heading link is correct and unsuppressed.
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 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 GitlabCiFormatter
impl RequirementResolution for GitlabCiFormatter
Source§fn requirement_is_unresolved(&self, requirement: &VersionReq) -> bool
fn requirement_is_unresolved(&self, requirement: &VersionReq) -> bool
Whether requirement’s pin — classified purely from its own text, mirroring
crate::component::classify_component_pin_style’s shape-only rule — could not be
resolved to a concrete version constraint: a SHA or branch-shaped ref.
Text-only, so ambiguous for a shape shared between grammars (#466 review M-c) — a
caller that already has the dependency in hand should call
Self::requirement_status_for instead, which consults its authoritative
crate::types::PinStyle rather than re-guessing from text.
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
~latest is always up to date (it dynamically tracks the newest release, like an
existence wildcard). A Partial pin (1.2, 1) is up to date while latest falls
within its GitLab tilde-range semantics. A Tag pin is compared by normalized
exact-string equality. A SHA/branch pin returns true unconditionally — never a
false “outdated” (the diagnostic itself is separately gated by
Self::requirement_is_unresolved; this is the boolean fallback for a caller that
does not consult that first, e.g. the “Update N outdated” code lens).
Text-only, so ambiguous for a shape shared between grammars — see
Self::requirement_status_for’s doc for the dependency-aware alternative a caller
holding the dependency should prefer.
Source§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
#466 review M-c: consults dep’s own parse-time PinStyle (authoritative — set
once, at parse time, from the correct project-vs-component grammar) instead of
re-classifying requirement’s raw text, which is ambiguous between the two:
"1.2" is PinStyle::Partial under the component: pin grammar
(crate::component::classify_component_pin_style) but PinStyle::Branch under
the simpler project: ref grammar (crate::parser’s classify_project_pin) —
indistinguishable from the text alone. This is the same source of truth
PackageRendering::format_version_replacing_for already consults, so the two can
no longer disagree about the same dependency (previously: the outdated diagnostic
text-reclassified a project: ref: "1.2" as Partial and silently suppressed
itself, while the code action offered by format_version_replacing_for’s correct
Branch classification still treated it as a normal, bumpable pin).
Source§fn version_satisfies_requirement(
&self,
version: &ConcreteVersion,
requirement: &str,
) -> bool
fn version_satisfies_requirement( &self, version: &ConcreteVersion, requirement: &str, ) -> bool
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 compile_requirement(
&self,
_requirement: &VersionReq,
) -> Option<Box<dyn RequirementMatcher>>
fn compile_requirement( &self, _requirement: &VersionReq, ) -> Option<Box<dyn RequirementMatcher>>
requirement into a matcher for precise membership testing against a list
of candidate version strings, or None when this ecosystem cannot parse or cannot
model this requirement form — in which case no unsatisfiable-requirement diagnostic
is produced for it. 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 GitlabCiFormatter
impl SourcePolicy for GitlabCiFormatter
Source§fn can_resolve_source(&self, source: &DependencySource) -> bool
fn can_resolve_source(&self, source: &DependencySource) -> bool
Only a source this crate’s registry actually routes — mirrors every other
per-source-routing ecosystem’s override (deps-npm, deps-pypi, deps-go,
deps-nuget). Pure function of source; must never read live configuration (spec
§4.5 — a live-reading predicate here would replace the correct FR-012 informational
diagnostic with a false “Unknown package” the moment a config change flips it, while
the background fetch it would then imply has not actually run).
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 !RefUnwindSafe for GitlabCiFormatter
impl !UnwindSafe for GitlabCiFormatter
impl Freeze for GitlabCiFormatter
impl Send for GitlabCiFormatter
impl Sync for GitlabCiFormatter
impl Unpin for GitlabCiFormatter
impl UnsafeUnpin for GitlabCiFormatter
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