Skip to main content

generate_diagnostics_from_cache

Function generate_diagnostics_from_cache 

Source
pub fn generate_diagnostics_from_cache(
    parse_result: &dyn ParseResult,
    versions: VersionData<'_>,
    formatter: &dyn EcosystemFormatter,
    uri: &Uri,
    freshness: FreshnessSettings,
    severities: DiagnosticSeverities,
    now: PublishTime,
) -> Vec<Diagnostic>
Expand description

Generates diagnostics using cached versions (no network calls).

Uses pre-fetched version information from the lifecycle’s parallel fetch. This avoids making additional network requests during diagnostic generation.

§Arguments

  • parse_result - Parsed dependencies from manifest
  • versions - Latest (registry) and resolved (lock file) version maps, keyed by package name
  • formatter - Ecosystem-specific formatting and comparison logic
  • uri - Document URI, used only to anchor the [Location] of any [DiagnosticRelatedInformation] entries attached to a collapsed fetch-failure diagnostic (#479/#480 S2) — every other diagnostic here is scoped to the document it’s published under implicitly and doesn’t need it
  • freshness - Whether to differentiate an “outdated” diagnostic still within the release cooldown window (severity is unaffected either way — see the “Newer version available” message below)
  • severities - Configured severity for each diagnostic category
  • now - The instant every publish age in this call is computed against. Taken as a parameter rather than read internally via PublishTime::now() (issue #227 M4) so callers can pin an exact cooldown-boundary instant deterministically in tests, and so every dependency in one document is aged against the same instant.