backtrace-ls 0.0.4

See failed assertions as diagnostic messages next to your test code.
docs.rs failed to build backtrace-ls-0.0.4
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: backtrace-ls-0.0.5

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)

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

(Under construction)

Optional .backtrace-ls.toml in project root:

[overrides.override-name]
runner_name = "cargo-test"
extra_arg = ["--workspace"]

Contributing

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

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

License

MIT