deps-core
Core abstractions for deps-lsp: traits, caching, and generic LSP handlers.
This crate provides the shared infrastructure used by all ecosystem-specific crates in the deps-lsp workspace. Every ecosystem crate depends on deps-core and implements its Ecosystem trait.
What this crate provides
Ecosystemtrait — Unified interface for all package ecosystems (parse, registry, format)EcosystemIdenum — Exhaustive, typed identifier for every registered ecosystem, withDisplay/FromStrinterop withEcosystem::id(). Downstream code should match on this instead of the raw id string so a new ecosystem forces every relevantmatchto be updated at compile timeRegistrytrait — Abstraction over package registries with version lookupLockFileProvidertrait — Abstract lock file parsing for resolved versions- Generic LSP handlers —
generate_inlay_hints,generate_hover,generate_code_actions,generate_diagnostics, taking a bundledVersionData(cached + resolved version maps) to avoid swapping same-typed arguments at call sites HttpCache— ETag/Last-Modified caching for registry HTTP requests, with a streaming 32 MiB response-size capcheck_toml_nesting_depth— single-pass structural guard rejecting pathologically nested TOML (bracket depth and dotted-key/header segment count) before it reaches the recursive-descenttoml_spanparserlockfile::read_lockfile_content— shared read-and-error-wrap helper for lock file parsers- Error types — Unified error handling with
thiserror
Installation
[]
= "0.10"
[!IMPORTANT] Requires Rust 1.91 or later.
Implementing a new ecosystem
use ;