23 releases (7 breaking)
Uses new Rust 2024
| 0.9.3 | Mar 28, 2026 |
|---|---|
| 0.9.0 | Feb 23, 2026 |
| 0.5.2 | Dec 27, 2025 |
#156 in Text editors
29 downloads per month
Used in 11 crates
260KB
5.5K
SLoC
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)Registrytrait — 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 HttpCache— ETag/Last-Modified caching for registry HTTP requests- Error types — Unified error handling with
thiserror
Installation
[dependencies]
deps-core = "0.9.3"
[!IMPORTANT] Requires Rust 1.89 or later.
Implementing a new ecosystem
use deps_core::{Ecosystem, Registry, ParseResult};
pub struct MyEcosystem {
registry: Arc<MyRegistry>,
}
impl Ecosystem for MyEcosystem {
fn id(&self) -> &'static str { "my-ecosystem" }
fn display_name(&self) -> &'static str { "My Ecosystem" }
fn matches_uri(&self, uri: &Uri) -> bool {
uri.path().ends_with("my-manifest.json")
}
async fn parse_manifest(&self, content: &str, uri: &Uri) -> Result<ParseResult> {
// Parse the manifest and return dependencies with source positions
todo!()
}
}
License
Dependencies
~13–22MB
~303K SLoC