Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jobs:
- name: Generate per-crate coverage
run: |
# Generate coverage for each crate separately
for crate in deps-core deps-cargo deps-npm deps-pypi deps-lsp; do
for crate in deps-core deps-cargo deps-npm deps-pypi deps-go deps-lsp; do
echo "Generating coverage for $crate..."
cargo llvm-cov --all-features --package "$crate" --lcov \
--output-path "lcov-$crate.info" nextest 2>/dev/null || true
Expand Down Expand Up @@ -261,6 +261,14 @@ jobs:
flags: deps-pypi
fail_ci_if_error: false

- name: Upload deps-go coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov-deps-go.info
flags: deps-go
fail_ci_if_error: false

- name: Upload deps-lsp coverage
uses: codecov/codecov-action@v5
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ target

# Testing
.snapshots/
**/snapshots/

# Local development
.local/
Expand Down
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ deps-core = { version = "0.4.1", path = "crates/deps-core" }
deps-cargo = { version = "0.4.1", path = "crates/deps-cargo" }
deps-npm = { version = "0.4.1", path = "crates/deps-npm" }
deps-pypi = { version = "0.4.1", path = "crates/deps-pypi" }
deps-go = { version = "0.4.1", path = "crates/deps-go" }
deps-lsp = { version = "0.4.1", path = "crates/deps-lsp" }
futures = "0.3"
insta = "1"
Expand All @@ -28,6 +29,7 @@ once_cell = "1.20"
pep440_rs = "0.7"
pep508_rs = "0.9"
bytes = "1"
regex = "1"
reqwest = { version = "0.12", default-features = false }
semver = "1"
serde = "1"
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A universal Language Server Protocol (LSP) server for dependency management acro

- **Intelligent Autocomplete** — Package names, versions, and feature flags
- **Version Hints** — Inlay hints showing latest available versions
- **Lock File Support** — Reads resolved versions from Cargo.lock, package-lock.json, poetry.lock, uv.lock
- **Lock File Support** — Reads resolved versions from Cargo.lock, package-lock.json, poetry.lock, uv.lock, go.sum
- **Diagnostics** — Warnings for outdated, unknown, or yanked dependencies
- **Hover Information** — Package descriptions with resolved version from lock file
- **Code Actions** — Quick fixes to update dependencies
Expand Down Expand Up @@ -43,10 +43,14 @@ deps-lsp is optimized for responsiveness:
| Rust/Cargo | `Cargo.toml` | ✅ Supported |
| npm | `package.json` | ✅ Supported |
| Python/PyPI | `pyproject.toml` | ✅ Supported |
| Go Modules | `go.mod` | ✅ Supported |

> [!NOTE]
> PyPI support includes PEP 621, PEP 735 (dependency-groups), and Poetry formats.

> [!NOTE]
> Go support includes require, replace, and exclude directives with pseudo-version handling.

## Installation

### From crates.io
Expand Down Expand Up @@ -185,6 +189,7 @@ deps-lsp/
│ ├── deps-cargo/ # Cargo.toml parser + crates.io registry
│ ├── deps-npm/ # package.json parser + npm registry
│ ├── deps-pypi/ # pyproject.toml parser + PyPI registry
│ ├── deps-go/ # go.mod parser + proxy.golang.org
│ ├── deps-lsp/ # Main LSP server
│ └── deps-zed/ # Zed extension (WASM)
├── .config/ # nextest configuration
Expand Down
2 changes: 1 addition & 1 deletion crates/deps-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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`).
This crate provides the shared infrastructure used by ecosystem-specific crates (`deps-cargo`, `deps-npm`, `deps-pypi`, `deps-go`).

## Features

Expand Down
27 changes: 27 additions & 0 deletions crates/deps-go/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "deps-go"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
description = "Go module support for deps-lsp"

[dependencies]
deps-core = { workspace = true }
async-trait.workspace = true
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tokio.workspace = true
tower-lsp-server.workspace = true
tracing.workspace = true
regex.workspace = true
once_cell.workspace = true
semver.workspace = true

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt"] }
tokio-test.workspace = true
tempfile.workspace = true
74 changes: 74 additions & 0 deletions crates/deps-go/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# deps-go

[![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)
[![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.

## Features

- **go.mod Parsing** — Parse `go.mod` with position tracking for all directives
- **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

## Usage

```toml
[dependencies]
deps-go = "0.4"
```

```rust
use deps_go::{parse_go_mod, GoRegistry};

let dependencies = parse_go_mod(content, &uri)?;
let registry = GoRegistry::new(cache);
let versions = registry.get_versions("github.com/gin-gonic/gin").await?;
```

## Supported Directives

### require

```go
require github.com/gin-gonic/gin v1.9.1
require (
github.com/stretchr/testify v1.8.4
golang.org/x/sync v0.5.0 // indirect
)
```

### replace

```go
replace github.com/old/module => github.com/new/module v1.0.0
replace github.com/local/module => ../local/module
```

### exclude

```go
exclude github.com/pkg/module v1.2.3
```

## Pseudo-version Support

Handles Go's pseudo-version format for unreleased commits:

```
v0.0.0-20191109021931-daa7c04131f5
```

Extracts base version and timestamp for display.

## License

[MIT](../../LICENSE)
Loading
Loading