From 06c81ecafbd214467a33d27f9a6065b0cdb0d4bc Mon Sep 17 00:00:00 2001 From: "Andrei G." Date: Sat, 21 Mar 2026 21:50:28 +0100 Subject: [PATCH 1/3] release: prepare v0.9.2 --- CHANGELOG.md | 11 ++++++++++- Cargo.lock | 24 ++++++++++++------------ Cargo.toml | 26 +++++++++++++------------- README.md | 2 +- 4 files changed, 36 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff4265c7..e6fef3fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.2] - 2026-03-21 + +### Fixed +- Add missing `offset_encoding` field to `InitializeResult` in LSP server + +### Security +- Update `quinn-proto` 0.11.13 -> 0.11.14 + ## [0.9.1] - 2026-03-04 ### Security @@ -401,7 +409,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - TLS enforced via rustls - cargo-deny configured for vulnerability scanning -[Unreleased]: https://github.com/bug-ops/deps-lsp/compare/v0.9.1...HEAD +[Unreleased]: https://github.com/bug-ops/deps-lsp/compare/v0.9.2...HEAD +[0.9.2]: https://github.com/bug-ops/deps-lsp/compare/v0.9.1...v0.9.2 [0.9.1]: https://github.com/bug-ops/deps-lsp/compare/v0.9.0...v0.9.1 [0.9.0]: https://github.com/bug-ops/deps-lsp/compare/v0.8.0...v0.9.0 [0.8.0]: https://github.com/bug-ops/deps-lsp/compare/v0.7.1...v0.8.0 diff --git a/Cargo.lock b/Cargo.lock index a3baafc9..668de191 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -421,7 +421,7 @@ dependencies = [ [[package]] name = "deps-bundler" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "criterion", @@ -441,7 +441,7 @@ dependencies = [ [[package]] name = "deps-cargo" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "criterion", @@ -462,7 +462,7 @@ dependencies = [ [[package]] name = "deps-composer" -version = "0.9.1" +version = "0.9.2" dependencies = [ "deps-core", "serde", @@ -477,7 +477,7 @@ dependencies = [ [[package]] name = "deps-core" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "bytes", @@ -499,7 +499,7 @@ dependencies = [ [[package]] name = "deps-dart" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "criterion", @@ -519,7 +519,7 @@ dependencies = [ [[package]] name = "deps-go" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "criterion", @@ -538,7 +538,7 @@ dependencies = [ [[package]] name = "deps-gradle" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "deps-core", @@ -556,7 +556,7 @@ dependencies = [ [[package]] name = "deps-lsp" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "criterion", @@ -588,7 +588,7 @@ dependencies = [ [[package]] name = "deps-maven" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "deps-core", @@ -607,7 +607,7 @@ dependencies = [ [[package]] name = "deps-npm" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "criterion", @@ -626,7 +626,7 @@ dependencies = [ [[package]] name = "deps-pypi" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "criterion", @@ -648,7 +648,7 @@ dependencies = [ [[package]] name = "deps-swift" -version = "0.9.1" +version = "0.9.2" dependencies = [ "deps-core", "insta", diff --git a/Cargo.toml b/Cargo.toml index 8ebc5558..cdb6eaf0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ exclude = ["crates/deps-zed"] resolver = "3" [workspace.package] -version = "0.9.1" +version = "0.9.2" edition = "2024" rust-version = "1.89" authors = ["Andrei G"] @@ -15,18 +15,18 @@ repository = "https://github.com/bug-ops/deps-lsp" async-trait = "0.1" criterion = "0.8" dashmap = "6.1" -deps-core = { version = "0.9.1", path = "crates/deps-core" } -deps-cargo = { version = "0.9.1", path = "crates/deps-cargo" } -deps-npm = { version = "0.9.1", path = "crates/deps-npm" } -deps-pypi = { version = "0.9.1", path = "crates/deps-pypi" } -deps-go = { version = "0.9.1", path = "crates/deps-go" } -deps-bundler = { version = "0.9.1", path = "crates/deps-bundler" } -deps-dart = { version = "0.9.1", path = "crates/deps-dart" } -deps-maven = { version = "0.9.1", path = "crates/deps-maven" } -deps-composer = { version = "0.9.1", path = "crates/deps-composer" } -deps-gradle = { version = "0.9.1", path = "crates/deps-gradle" } -deps-swift = { version = "0.9.1", path = "crates/deps-swift" } -deps-lsp = { version = "0.9.1", path = "crates/deps-lsp" } +deps-core = { version = "0.9.2", path = "crates/deps-core" } +deps-cargo = { version = "0.9.2", path = "crates/deps-cargo" } +deps-npm = { version = "0.9.2", path = "crates/deps-npm" } +deps-pypi = { version = "0.9.2", path = "crates/deps-pypi" } +deps-go = { version = "0.9.2", path = "crates/deps-go" } +deps-bundler = { version = "0.9.2", path = "crates/deps-bundler" } +deps-dart = { version = "0.9.2", path = "crates/deps-dart" } +deps-maven = { version = "0.9.2", path = "crates/deps-maven" } +deps-composer = { version = "0.9.2", path = "crates/deps-composer" } +deps-gradle = { version = "0.9.2", path = "crates/deps-gradle" } +deps-swift = { version = "0.9.2", path = "crates/deps-swift" } +deps-lsp = { version = "0.9.2", path = "crates/deps-lsp" } futures = "0.3" insta = "1" mockito = "1" diff --git a/README.md b/README.md index 93044b12..bc33e465 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ deps-lsp is optimized for responsiveness: cargo install deps-lsp ``` -Latest published crate version: `0.9.1`. +Latest published crate version: `0.9.2`. > [!TIP] > Use `cargo binstall deps-lsp` for faster installation without compilation. From ca1c6e1a468ef38e3b872e6ec6e60569d8b34bd9 Mon Sep 17 00:00:00 2001 From: "Andrei G." Date: Sat, 21 Mar 2026 22:02:35 +0100 Subject: [PATCH 2/3] chore(deps-zed): update submodule to fa496ea --- crates/deps-zed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/deps-zed b/crates/deps-zed index 527688b5..fa496ea7 160000 --- a/crates/deps-zed +++ b/crates/deps-zed @@ -1 +1 @@ -Subproject commit 527688b5d54258deb85963cd71d77630b00272c0 +Subproject commit fa496ea7c3affa1b6b552014cd943ef87ac7cf1d From b7d44c1ca3f30acf16811e7bcbc0e790f47df30d Mon Sep 17 00:00:00 2001 From: "Andrei G." Date: Sat, 21 Mar 2026 22:03:02 +0100 Subject: [PATCH 3/3] docs: update README files for all workspace crates --- README.md | 99 ++++++++++++++++------------------ crates/deps-bundler/README.md | 27 ++++++---- crates/deps-cargo/README.md | 25 +++++---- crates/deps-composer/README.md | 27 ++++++---- crates/deps-core/README.md | 54 +++++++++++-------- crates/deps-go/README.md | 31 ++++++----- crates/deps-lsp/README.md | 52 ++++++++++++++---- crates/deps-maven/README.md | 27 ++++++---- crates/deps-npm/README.md | 25 +++++---- crates/deps-pypi/README.md | 35 ++++++------ 10 files changed, 237 insertions(+), 165 deletions(-) diff --git a/README.md b/README.md index bc33e465..46e06aea 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,16 @@ # deps-lsp [![Crates.io](https://img.shields.io/crates/v/deps-lsp)](https://crates.io/crates/deps-lsp) -[![docs.rs](https://img.shields.io/docsrs/deps-lsp)](https://docs.rs/deps-lsp) +[![CI](https://github.com/bug-ops/deps-lsp/actions/workflows/ci.yml/badge.svg)](https://github.com/bug-ops/deps-lsp/actions) [![codecov](https://codecov.io/gh/bug-ops/deps-lsp/graph/badge.svg?token=S71PTINTGQ)](https://codecov.io/gh/bug-ops/deps-lsp) -[![CI](https://img.shields.io/github/actions/workflow/status/bug-ops/deps-lsp/ci.yml?branch=main)](https://github.com/bug-ops/deps-lsp/actions) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![MSRV](https://img.shields.io/badge/MSRV-1.89-blue)](https://blog.rust-lang.org/) [![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/) A universal Language Server Protocol (LSP) server for dependency management across Cargo, npm, PyPI, Go, Bundler, Dart, Maven, Gradle, Swift, and Composer ecosystems. +![deps-lsp in action](https://raw.githubusercontent.com/bug-ops/deps-zed/main/assets/img.png) + ## Features - **Intelligent autocomplete** — Package names, versions, and feature flags @@ -21,36 +22,20 @@ A universal Language Server Protocol (LSP) server for dependency management acro - **Code actions** — Quick fixes to update dependencies - **High performance** — Parallel fetching with per-dependency timeouts, optimized caching -![deps-lsp in action](https://raw.githubusercontent.com/bug-ops/deps-zed/main/assets/img.png) - -## Performance - -deps-lsp is optimized for responsiveness: - -| Operation | Latency | Notes | -| ----------- | --------- | ------- | -| Document open (50 deps) | ~150ms | Parallel registry fetching | -| Inlay hints | <100ms | Cached version lookups | -| Hover | <50ms | Pre-fetched metadata | -| Code actions | <50ms | No network calls | - -> [!TIP] -> Lock file support provides instant resolved versions without network requests. - ## Supported ecosystems | Language | Ecosystem | Manifest file | Status | | ---------- | ----------- | --------------- | -------- | -| Rust | Cargo | `Cargo.toml` | ✅ Supported | -| JavaScript | npm | `package.json` | ✅ Supported | -| Python | PyPI | `pyproject.toml` | ✅ Supported | -| Go | Go Modules | `go.mod` | ✅ Supported | -| Ruby | Bundler | `Gemfile` | ✅ Supported | -| Dart | Pub | `pubspec.yaml` | ✅ Supported | -| Java | Maven | `pom.xml` | ✅ Supported | -| Java | Gradle | `libs.versions.toml`, `build.gradle.kts`, `build.gradle`, `settings.gradle` | ✅ Supported | -| Swift | SPM | `Package.swift` | ✅ Supported | -| PHP | Composer | `composer.json` | ✅ Supported | +| Rust | Cargo | `Cargo.toml` | Supported | +| JavaScript | npm | `package.json` | Supported | +| Python | PyPI | `pyproject.toml` | Supported | +| Go | Go Modules | `go.mod` | Supported | +| Ruby | Bundler | `Gemfile` | Supported | +| Dart | Pub | `pubspec.yaml` | Supported | +| Java | Maven | `pom.xml` | Supported | +| Java | Gradle | `libs.versions.toml`, `build.gradle.kts`, `build.gradle`, `settings.gradle` | Supported | +| Swift | SPM | `Package.swift` | Supported | +| PHP | Composer | `composer.json` | Supported | > [!NOTE] > **Ecosystem details:** @@ -71,19 +56,9 @@ deps-lsp is optimized for responsiveness: cargo install deps-lsp ``` -Latest published crate version: `0.9.2`. - > [!TIP] > Use `cargo binstall deps-lsp` for faster installation without compilation. -### From source - -```bash -git clone https://github.com/bug-ops/deps-lsp -cd deps-lsp -cargo install --path crates/deps-lsp -``` - ### Pre-built binaries Download from [GitHub Releases](https://github.com/bug-ops/deps-lsp/releases/latest): @@ -97,6 +72,14 @@ Download from [GitHub Releases](https://github.com/bug-ops/deps-lsp/releases/lat | Windows | x86_64 | `deps-lsp-x86_64-pc-windows-msvc.exe` | | Windows | ARM64 | `deps-lsp-aarch64-pc-windows-msvc.exe` | +### From source + +```bash +git clone https://github.com/bug-ops/deps-lsp +cd deps-lsp +cargo install --path crates/deps-lsp +``` + ## Feature flags By default, all ecosystems are enabled. To build with specific ecosystems only: @@ -111,16 +94,16 @@ cargo install deps-lsp --no-default-features --features "pypi" | Feature | Language | Manifest | Default | | --------- | ---------- | ----------- | ------- | -| `cargo` | Rust | Cargo.toml | ✅ | -| `npm` | JavaScript | package.json | ✅ | -| `pypi` | Python | pyproject.toml | ✅ | -| `go` | Go | go.mod | ✅ | -| `bundler` | Ruby | Gemfile | ✅ | -| `dart` | Dart | pubspec.yaml | ✅ | -| `maven` | Java | pom.xml | ✅ | -| `gradle` | Java | libs.versions.toml, build.gradle.kts, build.gradle | ✅ | -| `swift` | Swift | Package.swift | ✅ | -| `composer` | PHP | composer.json | ✅ | +| `cargo` | Rust | Cargo.toml | Yes | +| `npm` | JavaScript | package.json | Yes | +| `pypi` | Python | pyproject.toml | Yes | +| `go` | Go | go.mod | Yes | +| `bundler` | Ruby | Gemfile | Yes | +| `dart` | Dart | pubspec.yaml | Yes | +| `maven` | Java | pom.xml | Yes | +| `gradle` | Java | libs.versions.toml, build.gradle.kts, build.gradle | Yes | +| `swift` | Swift | Package.swift | Yes | +| `composer` | PHP | composer.json | Yes | ## Usage @@ -145,7 +128,6 @@ Install the **Deps** extension from Zed Extensions marketplace. Ruby support is Enable inlay hints in Zed settings: ```json -// settings.json { "inlay_hints": { "enabled": true @@ -197,7 +179,6 @@ display-inlay-hints = true Install an LSP client extension and configure deps-lsp. Enable inlay hints: ```json -// settings.json { "editor.inlayHints.enabled": "on" } @@ -228,7 +209,7 @@ Configure via LSP initialization options: "loading_indicator": { "enabled": true, "fallback_to_hints": true, - "loading_text": "⏳" + "loading_text": "..." }, "cold_start": { "enabled": true, @@ -245,7 +226,7 @@ Configure via LSP initialization options: | `cache` | `max_concurrent_fetches` | `20` | Concurrent registry requests (1-100) | | `loading_indicator` | `enabled` | `true` | Show loading feedback during fetches | | `loading_indicator` | `fallback_to_hints` | `true` | Show loading in inlay hints if LSP progress unsupported | -| `loading_indicator` | `loading_text` | `"⏳"` | Text shown during loading (max 100 chars) | +| `loading_indicator` | `loading_text` | `"..."` | Text shown during loading (max 100 chars) | > [!TIP] > Increase `fetch_timeout_secs` for slower networks. The per-dependency timeout prevents slow packages from blocking others. Cold start support ensures LSP features work immediately when your IDE restores previously opened files. @@ -276,6 +257,20 @@ alias zed='env GITHUB_TOKEN=(gh auth token) command zed' > [!TIP] > Add the alias to your shell profile (`~/.zshrc`, `~/.bashrc`, `~/.config/fish/config.fish`) for persistence. +## Performance + +deps-lsp is optimized for responsiveness: + +| Operation | Latency | Notes | +| ----------- | --------- | ------- | +| Document open (50 deps) | ~150ms | Parallel registry fetching | +| Inlay hints | <100ms | Cached version lookups | +| Hover | <50ms | Pre-fetched metadata | +| Code actions | <50ms | No network calls | + +> [!TIP] +> Lock file support provides instant resolved versions without network requests. + ## Development > [!IMPORTANT] diff --git a/crates/deps-bundler/README.md b/crates/deps-bundler/README.md index 3401f0a9..e2d99c92 100644 --- a/crates/deps-bundler/README.md +++ b/crates/deps-bundler/README.md @@ -2,30 +2,35 @@ [![Crates.io](https://img.shields.io/crates/v/deps-bundler)](https://crates.io/crates/deps-bundler) [![docs.rs](https://img.shields.io/docsrs/deps-bundler)](https://docs.rs/deps-bundler) +[![CI](https://github.com/bug-ops/deps-lsp/actions/workflows/ci.yml/badge.svg)](https://github.com/bug-ops/deps-lsp/actions) [![codecov](https://codecov.io/gh/bug-ops/deps-lsp/graph/badge.svg?token=S71PTINTGQ&flag=deps-bundler)](https://codecov.io/gh/bug-ops/deps-lsp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE) Gemfile support for deps-lsp. -This crate provides Bundler-specific functionality for the deps-lsp server, including Gemfile DSL parsing, dependency extraction, and rubygems.org registry integration. +This crate is part of the [deps-lsp](https://github.com/bug-ops/deps-lsp) workspace. It provides Bundler-specific functionality including Gemfile DSL parsing, dependency extraction, and rubygems.org registry integration, and implements `deps_core::Ecosystem`. ## Features -- **Gemfile Parsing** — Parse `Gemfile` with position tracking using regex-based DSL parser -- **Lock File Parsing** — Extract resolved versions from `Gemfile.lock` -- **rubygems.org Registry** — HTTP client for version lookups and package search -- **Version Resolution** — Ruby-aware version matching with pessimistic operator (`~>`) -- **Dependency Sources** — Support for registry, git, path, and github dependencies -- **Group Handling** — Handle `:development`, `:test`, `:production` groups -- **Ecosystem Trait** — Implements `deps_core::Ecosystem` trait +- **Gemfile parsing** — Parse `Gemfile` with position tracking via a regex-based DSL parser +- **Lock file parsing** — Extract resolved versions from `Gemfile.lock` +- **rubygems.org registry** — HTTP client for version lookups and package search +- **Version resolution** — Ruby-aware version matching with pessimistic operator (`~>`) +- **Dependency sources** — Support for registry, git, path, and github dependencies +- **Group handling** — Handle `:development`, `:test`, `:production` groups -## Usage +## Installation ```toml [dependencies] -deps-bundler = "0.5" +deps-bundler = "0.9.2" ``` +> [!IMPORTANT] +> Requires Rust 1.89 or later. + +## Usage + ```rust use deps_bundler::{parse_gemfile, RubyGemsRegistry}; @@ -34,7 +39,7 @@ let registry = RubyGemsRegistry::new(cache); let versions = registry.get_versions("rails").await?; ``` -## Supported Gemfile Syntax +## Supported Gemfile syntax ```ruby source "https://rubygems.org" diff --git a/crates/deps-cargo/README.md b/crates/deps-cargo/README.md index f33ae697..6d313846 100644 --- a/crates/deps-cargo/README.md +++ b/crates/deps-cargo/README.md @@ -2,29 +2,34 @@ [![Crates.io](https://img.shields.io/crates/v/deps-cargo)](https://crates.io/crates/deps-cargo) [![docs.rs](https://img.shields.io/docsrs/deps-cargo)](https://docs.rs/deps-cargo) +[![CI](https://github.com/bug-ops/deps-lsp/actions/workflows/ci.yml/badge.svg)](https://github.com/bug-ops/deps-lsp/actions) [![codecov](https://codecov.io/gh/bug-ops/deps-lsp/graph/badge.svg?token=S71PTINTGQ&flag=deps-cargo)](https://codecov.io/gh/bug-ops/deps-lsp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE) Cargo.toml support for deps-lsp. -This crate provides parsing and registry integration for Rust's Cargo ecosystem. +This crate is part of the [deps-lsp](https://github.com/bug-ops/deps-lsp) workspace. It provides parsing and registry integration for the Rust/Cargo ecosystem and implements `deps_core::Ecosystem`. ## Features -- **TOML Parsing** — Parse `Cargo.toml` with position tracking using `toml-span` -- **Lock File Parsing** — Extract resolved versions from `Cargo.lock` -- **crates.io Registry** — Sparse index client for package metadata -- **Version Resolution** — Semver-aware version matching -- **Workspace Support** — Handle `workspace.dependencies` inheritance -- **EcosystemHandler** — Implements `deps_core::EcosystemHandler` trait +- **TOML parsing** — Parse `Cargo.toml` with byte-accurate position tracking via `toml-span` +- **Lock file parsing** — Extract resolved versions from `Cargo.lock` +- **crates.io registry** — Sparse index client for version lookups and package metadata +- **Semver resolution** — Resolve `^`, `~`, `*`, and range specifiers against available versions +- **Workspace support** — Handle `workspace.dependencies` inheritance and `version.workspace = true` -## Usage +## Installation ```toml [dependencies] -deps-cargo = "0.5" +deps-cargo = "0.9.2" ``` +> [!IMPORTANT] +> Requires Rust 1.89 or later. + +## Usage + ```rust use deps_cargo::{parse_cargo_toml, CratesIoRegistry}; @@ -39,7 +44,7 @@ let versions = registry.get_versions("serde").await?; cargo bench -p deps-cargo ``` -Parsing performance: ~4μs for small files, ~55μs for large files (100+ dependencies). +Parsing performance: ~4 us for small files, ~55 us for large files (100+ dependencies). ## License diff --git a/crates/deps-composer/README.md b/crates/deps-composer/README.md index 1ae4be34..2263a33c 100644 --- a/crates/deps-composer/README.md +++ b/crates/deps-composer/README.md @@ -2,29 +2,38 @@ [![Crates.io](https://img.shields.io/crates/v/deps-composer)](https://crates.io/crates/deps-composer) [![docs.rs](https://img.shields.io/docsrs/deps-composer)](https://docs.rs/deps-composer) +[![CI](https://github.com/bug-ops/deps-lsp/actions/workflows/ci.yml/badge.svg)](https://github.com/bug-ops/deps-lsp/actions) [![codecov](https://codecov.io/gh/bug-ops/deps-lsp/graph/badge.svg?token=S71PTINTGQ&flag=deps-composer)](https://codecov.io/gh/bug-ops/deps-lsp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE) PHP/Composer support for deps-lsp. -This crate provides parsing and registry integration for the Composer ecosystem. +This crate is part of the [deps-lsp](https://github.com/bug-ops/deps-lsp) workspace. It provides parsing and registry integration for the Composer ecosystem and implements `deps_core::Ecosystem`. ## Features -- **JSON Parsing** — Parse `composer.json` with position tracking for `require` and `require-dev` -- **Lock File Parsing** — Extract resolved versions from `composer.lock` -- **Packagist Registry** — Client for Packagist v2 API with metadata de-minification -- **Version Resolution** — Composer-specific version matching (`^`, `~`, `*`, `||`, ranges) -- **Platform Filtering** — Excludes `php`, `ext-*`, `lib-*` from registry lookups -- **Case-insensitive** — Package names normalized to lowercase (`vendor/package`) +- **JSON parsing** — Parse `composer.json` with position tracking for `require` and `require-dev` sections +- **Lock file parsing** — Extract resolved versions from `composer.lock` +- **Packagist registry** — Client for Packagist v2 API with metadata de-minification +- **Version resolution** — Composer-specific version matching (`^`, `~`, `*`, `||`, ranges) +- **Platform filtering** — Excludes `php`, `ext-*`, and `lib-*` pseudo-packages from registry lookups +- **Case-insensitive names** — Package names normalized to lowercase (`vendor/package`) -## Usage +> [!NOTE] +> Composer's tilde operator has different semantics from npm: `~1.2` means `>=1.2.0 <2.0.0` (not `>=1.2.0 <1.3.0`). + +## Installation ```toml [dependencies] -deps-composer = "0.8" +deps-composer = "0.9.2" ``` +> [!IMPORTANT] +> Requires Rust 1.89 or later. + +## Usage + ```rust use deps_composer::{parse_composer_json, PackagistRegistry}; diff --git a/crates/deps-core/README.md b/crates/deps-core/README.md index 0599c483..fd40f3d1 100644 --- a/crates/deps-core/README.md +++ b/crates/deps-core/README.md @@ -2,47 +2,55 @@ [![Crates.io](https://img.shields.io/crates/v/deps-core)](https://crates.io/crates/deps-core) [![docs.rs](https://img.shields.io/docsrs/deps-core)](https://docs.rs/deps-core) +[![CI](https://github.com/bug-ops/deps-lsp/actions/workflows/ci.yml/badge.svg)](https://github.com/bug-ops/deps-lsp/actions) [![codecov](https://codecov.io/gh/bug-ops/deps-lsp/graph/badge.svg?token=S71PTINTGQ&flag=deps-core)](https://codecov.io/gh/bug-ops/deps-lsp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE) Core abstractions for deps-lsp: traits, caching, and generic LSP handlers. -This crate provides the shared infrastructure used by ecosystem-specific crates (`deps-cargo`, `deps-npm`, `deps-pypi`, `deps-go`). +This crate provides the shared infrastructure used by all ecosystem-specific crates in the [deps-lsp](https://github.com/bug-ops/deps-lsp) workspace. Every ecosystem crate depends on `deps-core` and implements its `Ecosystem` trait. -## Features +## What this crate provides -- **EcosystemHandler Trait** — Unified interface for all package ecosystems -- **LockFileProvider Trait** — Abstract lock file parsing for resolved versions -- **Generic LSP Handlers** — `generate_inlay_hints`, `generate_hover`, `generate_code_actions`, `generate_diagnostics` -- **HTTP Cache** — ETag/Last-Modified caching for registry requests -- **Version Matchers** — Semver and PEP 440 version matching -- **Error Types** — Unified error handling with `thiserror` +- **`Ecosystem` trait** — Unified interface for all package ecosystems (parse, registry, format) +- **`Registry` trait** — Abstraction over package registries with version lookup +- **`LockFileProvider` trait** — 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` -## Usage +## Installation ```toml [dependencies] -deps-core = "0.5" +deps-core = "0.9.2" ``` -```rust -use deps_core::{EcosystemHandler, HttpCache, PackageRegistry}; -``` +> [!IMPORTANT] +> Requires Rust 1.89 or later. -## Architecture +## Implementing a new ecosystem ```rust -// Implement EcosystemHandler for your ecosystem -#[async_trait] -impl EcosystemHandler for MyHandler { - type Registry = MyRegistry; - type Dependency = MyDependency; - // ... +use deps_core::{Ecosystem, Registry, ParseResult}; + +pub struct MyEcosystem { + registry: Arc, } -// Use generic handlers -let hints = generate_inlay_hints::(&handler, &deps).await; -let hover = generate_hover_info::(&handler, &dep, &versions); +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 { + // Parse the manifest and return dependencies with source positions + todo!() + } +} ``` ## License diff --git a/crates/deps-go/README.md b/crates/deps-go/README.md index 16e05048..26a2959e 100644 --- a/crates/deps-go/README.md +++ b/crates/deps-go/README.md @@ -2,31 +2,36 @@ [![Crates.io](https://img.shields.io/crates/v/deps-go)](https://crates.io/crates/deps-go) [![docs.rs](https://img.shields.io/docsrs/deps-go)](https://docs.rs/deps-go) +[![CI](https://github.com/bug-ops/deps-lsp/actions/workflows/ci.yml/badge.svg)](https://github.com/bug-ops/deps-lsp/actions) [![codecov](https://codecov.io/gh/bug-ops/deps-lsp/graph/badge.svg?token=S71PTINTGQ&flag=deps-go)](https://codecov.io/gh/bug-ops/deps-lsp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE) Go modules support for deps-lsp. -This crate provides parsing and registry integration for Go's module ecosystem. +This crate is part of the [deps-lsp](https://github.com/bug-ops/deps-lsp) workspace. It provides parsing and registry integration for Go's module ecosystem and implements `deps_core::Ecosystem`. ## Features -- **go.mod Parsing** — Parse `go.mod` with position tracking for all directives -- **go.sum Lock File** — Extract resolved versions from `go.sum` -- **Directive Support** — Handle `require`, `replace`, `exclude`, and `retract` directives -- **Indirect Dependencies** — Detect and mark indirect dependencies (`// indirect`) -- **Pseudo-versions** — Parse and validate Go pseudo-version format -- **proxy.golang.org** — Fetch module versions from Go module proxy -- **Module Path Escaping** — Proper URL encoding for uppercase characters -- **EcosystemHandler** — Implements `deps_core::EcosystemHandler` trait +- **go.mod parsing** — Parse all directives with byte-accurate position tracking +- **go.sum lock file** — Extract resolved versions from `go.sum` +- **Directive support** — Handle `require`, `replace`, `exclude`, and `retract` directives +- **Indirect dependencies** — Detect and mark `// indirect` annotations +- **Pseudo-versions** — Parse and validate the `v0.0.0-YYYYMMDDHHMMSS-hash` format +- **proxy.golang.org** — Fetch module versions from the Go module proxy +- **Module path escaping** — Proper URL encoding for uppercase characters per Go spec -## Usage +## Installation ```toml [dependencies] -deps-go = "0.5" +deps-go = "0.9.2" ``` +> [!IMPORTANT] +> Requires Rust 1.89 or later. + +## Usage + ```rust use deps_go::{parse_go_mod, GoRegistry}; @@ -35,7 +40,7 @@ let registry = GoRegistry::new(cache); let versions = registry.get_versions("github.com/gin-gonic/gin").await?; ``` -## Supported Directives +## Supported directives ### require @@ -60,7 +65,7 @@ replace github.com/local/module => ../local/module exclude github.com/pkg/module v1.2.3 ``` -## Pseudo-version Support +## Pseudo-version support Handles Go's pseudo-version format for unreleased commits: diff --git a/crates/deps-lsp/README.md b/crates/deps-lsp/README.md index 49747cc6..dd180420 100644 --- a/crates/deps-lsp/README.md +++ b/crates/deps-lsp/README.md @@ -2,18 +2,22 @@ [![Crates.io](https://img.shields.io/crates/v/deps-lsp)](https://crates.io/crates/deps-lsp) [![docs.rs](https://img.shields.io/docsrs/deps-lsp)](https://docs.rs/deps-lsp) +[![CI](https://github.com/bug-ops/deps-lsp/actions/workflows/ci.yml/badge.svg)](https://github.com/bug-ops/deps-lsp/actions) [![codecov](https://codecov.io/gh/bug-ops/deps-lsp/graph/badge.svg?token=S71PTINTGQ&flag=deps-lsp)](https://codecov.io/gh/bug-ops/deps-lsp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE) -Language Server Protocol implementation for dependency management. +Language Server Protocol implementation for dependency management across ten package ecosystems. + +This crate is part of the [deps-lsp](https://github.com/bug-ops/deps-lsp) workspace. It provides the LSP server binary and the ecosystem orchestration layer that wires together ecosystem-specific crates (`deps-cargo`, `deps-npm`, `deps-pypi`, `deps-go`, `deps-bundler`, `deps-dart`, `deps-maven`, `deps-gradle`, `deps-swift`, `deps-composer`) via the `Ecosystem` trait from `deps-core`. ## Features -- **Multi-ecosystem** — Cargo.toml, package.json, pyproject.toml, go.mod, Gemfile, pubspec.yaml, pom.xml, composer.json -- **Inlay Hints** — Show latest versions inline -- **Hover Info** — Package descriptions and version lists -- **Code Actions** — Quick fixes to update dependencies -- **Diagnostics** — Warnings for outdated/yanked packages +- **Multi-ecosystem** — Cargo.toml, package.json, pyproject.toml, go.mod, Gemfile, pubspec.yaml, pom.xml, libs.versions.toml, Package.swift, composer.json +- **Inlay hints** — Show latest versions inline with loading indicators +- **Hover info** — Package descriptions with resolved version from lock file +- **Code actions** — Quick fixes to update dependencies +- **Diagnostics** — Warnings for outdated, yanked, or unknown packages +- **Lock file support** — Reads resolved versions without network requests ## Installation @@ -21,19 +25,45 @@ Language Server Protocol implementation for dependency management. cargo install deps-lsp ``` +> [!IMPORTANT] +> Requires Rust 1.89 or later. + ## Usage ```bash deps-lsp --stdio ``` -## Supported Editors +## Feature flags + +All ecosystems are enabled by default. Disable unused ones to reduce binary size: + +```toml +[dependencies] +deps-lsp = { version = "0.9.2", default-features = false, features = ["cargo", "npm"] } +``` + +| Feature | Ecosystem | Default | +| ------- | --------- | ------- | +| `cargo` | Rust / Cargo.toml | Yes | +| `npm` | JavaScript / package.json | Yes | +| `pypi` | Python / pyproject.toml | Yes | +| `go` | Go / go.mod | Yes | +| `bundler` | Ruby / Gemfile | Yes | +| `dart` | Dart / pubspec.yaml | Yes | +| `maven` | Java / pom.xml | Yes | +| `gradle` | Java / Version Catalog + DSL | Yes | +| `swift` | Swift / Package.swift | Yes | +| `composer` | PHP / composer.json | Yes | + +## Supported editors -- **Zed** — Install "Deps" extension -- **Neovim** — Configure with lspconfig -- **Helix** — Add to languages.toml +- **Zed** — Install the "Deps" extension from the Zed Extensions marketplace +- **Neovim** — Configure with `nvim-lspconfig` +- **Helix** — Add to `languages.toml` +- **VS Code** — Configure via any LSP client extension -See the [main repository](https://github.com/bug-ops/deps-lsp) for full documentation. +See the [main repository](https://github.com/bug-ops/deps-lsp) for full editor setup instructions and configuration reference. ## License diff --git a/crates/deps-maven/README.md b/crates/deps-maven/README.md index 2c461cfa..4a7e00fc 100644 --- a/crates/deps-maven/README.md +++ b/crates/deps-maven/README.md @@ -2,30 +2,35 @@ [![Crates.io](https://img.shields.io/crates/v/deps-maven)](https://crates.io/crates/deps-maven) [![docs.rs](https://img.shields.io/docsrs/deps-maven)](https://docs.rs/deps-maven) +[![CI](https://github.com/bug-ops/deps-lsp/actions/workflows/ci.yml/badge.svg)](https://github.com/bug-ops/deps-lsp/actions) [![codecov](https://codecov.io/gh/bug-ops/deps-lsp/graph/badge.svg?token=S71PTINTGQ&flag=deps-maven)](https://codecov.io/gh/bug-ops/deps-lsp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE) pom.xml support for deps-lsp. -This crate provides Maven/JVM ecosystem support for the deps-lsp server, including pom.xml parsing, dependency extraction, and Maven Central registry integration. +This crate is part of the [deps-lsp](https://github.com/bug-ops/deps-lsp) workspace. It provides Maven/JVM ecosystem support including pom.xml parsing, dependency extraction, and Maven Central registry integration, and implements `deps_core::Ecosystem`. ## Features -- **XML Parsing** — Parse `pom.xml` with byte-accurate position tracking using `quick-xml` SAX reader -- **Dependency Sections** — Handle ``, ``, and `` blocks -- **Maven Central Registry** — Solr API client for version lookups and artifact search -- **Version Comparison** — Maven version qualifier support (`alpha`, `beta`, `RC`, `SNAPSHOT`, `GA`) -- **Property Resolution** — Resolve `${property}` placeholders defined in `` -- **Scope Handling** — Recognise `compile`, `test`, `provided`, `runtime`, and `import` scopes -- **Ecosystem Trait** — Implements `deps_core::Ecosystem` trait +- **XML parsing** — Parse `pom.xml` with byte-accurate position tracking via the `quick-xml` SAX reader +- **Dependency sections** — Handle ``, ``, and `` blocks +- **Maven Central registry** — Solr API client for version lookups and artifact search +- **Version comparison** — Maven version qualifier support (`alpha`, `beta`, `RC`, `SNAPSHOT`, `GA`) +- **Property resolution** — Resolve `${property}` placeholders defined in `` +- **Scope handling** — Recognise `compile`, `test`, `provided`, `runtime`, and `import` scopes -## Usage +## Installation ```toml [dependencies] -deps-maven = "0.7" +deps-maven = "0.9.2" ``` +> [!IMPORTANT] +> Requires Rust 1.89 or later. + +## Usage + ```rust use deps_maven::{parse_pom_xml, MavenCentralRegistry}; @@ -34,7 +39,7 @@ let registry = MavenCentralRegistry::new(cache); let versions = registry.get_versions_typed("org.springframework:spring-core").await?; ``` -## Supported pom.xml Syntax +## Supported pom.xml syntax ```xml diff --git a/crates/deps-npm/README.md b/crates/deps-npm/README.md index 73a3f8ed..851a8661 100644 --- a/crates/deps-npm/README.md +++ b/crates/deps-npm/README.md @@ -2,29 +2,34 @@ [![Crates.io](https://img.shields.io/crates/v/deps-npm)](https://crates.io/crates/deps-npm) [![docs.rs](https://img.shields.io/docsrs/deps-npm)](https://docs.rs/deps-npm) +[![CI](https://github.com/bug-ops/deps-lsp/actions/workflows/ci.yml/badge.svg)](https://github.com/bug-ops/deps-lsp/actions) [![codecov](https://codecov.io/gh/bug-ops/deps-lsp/graph/badge.svg?token=S71PTINTGQ&flag=deps-npm)](https://codecov.io/gh/bug-ops/deps-lsp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE) npm/package.json support for deps-lsp. -This crate provides parsing and registry integration for the npm ecosystem. +This crate is part of the [deps-lsp](https://github.com/bug-ops/deps-lsp) workspace. It provides parsing and registry integration for the npm ecosystem and implements `deps_core::Ecosystem`. ## Features -- **JSON Parsing** — Parse `package.json` with position tracking -- **Lock File Parsing** — Extract resolved versions from `package-lock.json` (v2/v3) -- **npm Registry** — Client for npm registry API -- **Version Resolution** — Node semver-aware version matching (`^`, `~`, ranges) -- **Scoped Packages** — Support for `@scope/package` format -- **EcosystemHandler** — Implements `deps_core::EcosystemHandler` trait +- **JSON parsing** — Parse `package.json` with position tracking for `dependencies`, `devDependencies`, and `peerDependencies` +- **Lock file parsing** — Extract resolved versions from `package-lock.json` (v2/v3) +- **npm registry** — Client for npm registry API with metadata caching +- **Node semver resolution** — Full `^`, `~`, `>=`, `<`, range, and tag specifier support +- **Scoped packages** — Support for `@scope/package` format -## Usage +## Installation ```toml [dependencies] -deps-npm = "0.5" +deps-npm = "0.9.2" ``` +> [!IMPORTANT] +> Requires Rust 1.89 or later. + +## Usage + ```rust use deps_npm::{parse_package_json, NpmRegistry}; @@ -39,7 +44,7 @@ let versions = registry.get_versions("express").await?; cargo bench -p deps-npm ``` -Parsing performance: ~3μs for small files, ~45μs for monorepo package.json. +Parsing performance: ~3 us for small files, ~45 us for monorepo package.json. ## License diff --git a/crates/deps-pypi/README.md b/crates/deps-pypi/README.md index 473344f9..91b63080 100644 --- a/crates/deps-pypi/README.md +++ b/crates/deps-pypi/README.md @@ -2,31 +2,36 @@ [![Crates.io](https://img.shields.io/crates/v/deps-pypi)](https://crates.io/crates/deps-pypi) [![docs.rs](https://img.shields.io/docsrs/deps-pypi)](https://docs.rs/deps-pypi) +[![CI](https://github.com/bug-ops/deps-lsp/actions/workflows/ci.yml/badge.svg)](https://github.com/bug-ops/deps-lsp/actions) [![codecov](https://codecov.io/gh/bug-ops/deps-lsp/graph/badge.svg?token=S71PTINTGQ&flag=deps-pypi)](https://codecov.io/gh/bug-ops/deps-lsp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE) PyPI/Python support for deps-lsp. -This crate provides parsing and registry integration for Python's PyPI ecosystem. +This crate is part of the [deps-lsp](https://github.com/bug-ops/deps-lsp) workspace. It provides parsing and registry integration for Python's PyPI ecosystem and implements `deps_core::Ecosystem`. ## Features -- **PEP 621 Support** — Parse `[project.dependencies]` and `[project.optional-dependencies]` -- **PEP 735 Support** — Parse `[dependency-groups]` (new standard) -- **Poetry Support** — Parse `[tool.poetry.dependencies]` and groups -- **Lock File Parsing** — Extract resolved versions from `poetry.lock` and `uv.lock` -- **PEP 508 Parsing** — Handle complex dependency specifications with extras and markers -- **PEP 440 Versions** — Validate and compare Python version specifiers -- **PyPI API Client** — Fetch package metadata from PyPI JSON API -- **EcosystemHandler** — Implements `deps_core::EcosystemHandler` trait +- **PEP 621** — Parse `[project.dependencies]` and `[project.optional-dependencies]` +- **PEP 735** — Parse `[dependency-groups]` (new standard) +- **Poetry** — Parse `[tool.poetry.dependencies]` and dependency groups +- **Lock file parsing** — Extract resolved versions from `poetry.lock` and `uv.lock` +- **PEP 508 parsing** — Handle complex dependency specifications with extras and environment markers +- **PEP 440 versions** — Validate and compare Python version specifiers +- **PyPI API client** — Fetch package metadata from the PyPI JSON API -## Usage +## Installation ```toml [dependencies] -deps-pypi = "0.5" +deps-pypi = "0.9.2" ``` +> [!IMPORTANT] +> Requires Rust 1.89 or later. + +## Usage + ```rust use deps_pypi::{parse_pyproject_toml, PyPiRegistry}; @@ -35,9 +40,9 @@ let registry = PyPiRegistry::new(cache); let versions = registry.get_versions("requests").await?; ``` -## Supported Formats +## Supported formats -### PEP 621 (Standard) +### PEP 621 (standard) ```toml [project] @@ -50,7 +55,7 @@ dependencies = [ dev = ["pytest>=7.0", "mypy>=1.0"] ``` -### PEP 735 (Dependency Groups) +### PEP 735 (dependency groups) ```toml [dependency-groups] @@ -75,7 +80,7 @@ pytest = "^7.0" cargo bench -p deps-pypi ``` -Parsing performance: ~5μs for PEP 621, ~8μs for Poetry format. +Parsing performance: ~5 us for PEP 621, ~8 us for Poetry format. ## License