backtrace-ls 0.0.1

See failed assertions as diagnostic messages next to your test code.
Documentation

Backtrace-LS

LSP server that shows test failures as diagnostics. Backtraces are parsed to show additional info diagnostics at different stack frames. Supports jumping forwards and backwards between stack frames with code actions.

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

Helix code action screenshot

Supported Test Runners

  • Rust: cargo test, cargo nextest
  • JavaScript: Jest, Vitest, Node Test Runner, deno test
  • Go: go test
  • PHP: PHPUnit

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

Optional .backtrace-ls.toml in project root:

[adapters.rust]
test_kind = "cargo-test"
extra_arg = ["--workspace"]

License

MIT