backtrace-ls

Crates.iobacktrace-ls
lib.rsbacktrace-ls
version0.0.5
created_at2026-01-13 15:38:42.838864+00
updated_at2026-01-24 21:13:02.905458+00
descriptionSee failed assertions as diagnostic messages next to your test code.
homepage
repositoryhttps://codeberg.org/wvhulle/backtrace-ls
max_upload_size
id2040475
size870,757
Willem Vanhulle (wvhulle)

documentation

README

Backtrace-LS

LSP server that shows failed assertion messages as diagnostics in your code.

Additional features:

  • Backtraces are parsed to mark any stack frame locations inline.
  • You can use code actions to navigate between failure, stack frames and context.

Works out of the box in Helix (or any editor with an LSP client):

(screenshot of code action in helix)

Installation

cargo install backtrace-ls

Editor Setup

Try out without installing by opening the demo project with Helix:

cd demo/rust
hx -v src/lib.rs

You should see the failing assertions inline next to test code.

Helix (~/.config/helix/languages.toml):

[language-server.backtrace-ls]
command = "backtrace-ls"

[[language]]
name = "rust"
language-servers = ["backtrace-ls", "rust-analyzer"]

Neovim:

vim.lsp.start({ name = "backtrace-ls", cmd = { "backtrace-ls" }, root_dir = vim.fn.getcwd() })

Configuration

The language server auto-detects the test runner from your project files (e.g., Cargo.toml, package.json, go.mod).

Create .backtrace-ls.toml in your project root to customize behavior:

# Explicitly specify the test runner (optional)
# If not set, auto-detected from project files
runner = "cargo-test"

# Pass extra arguments to the test command
extra_args = ["--workspace", "--lib"]

# Show diagnostics for the entire function instead of just the assertion line
show_surrounding_function = false

CLI options:

# Explicitly specify runner (overrides auto-detection)
backtrace-ls --runner cargo-test

# Set workspace root for detection
backtrace-ls --path /path/to/project

# Run in text mode with file watching
backtrace-ls --text --verbose

Supported runners:

  • Rust: cargo-test, cargo-nextest
  • JavaScript/TypeScript: jest, vitest, node-test, deno
  • Go: go-test
  • PHP: phpunit
  • C++: gtest, catch2

Note: If multiple project types are detected, use --runner or the runner config option to specify which one to use.

Contributing

You can debug more easily by running in --text and --verbose mode:

cargo run -- --path demo/rust --text -v

License

MIT

Commit count: 210

cargo fmt