Language server for real-time testing diagnostics
Find a file
google-labs-jules[bot] ca66d265d1 feat: Add RSpec test adapter and perform project cleanup
This commit introduces a new test adapter for the RSpec testing framework
and includes general code cleanup.

RSpec Adapter Features:
- Implements the `Runner` trait for RSpec.
- Uses `tree-sitter-ruby` for test discovery from `*_spec.rb` files,
  identifying `describe`, `context`, and `it` blocks.
- Executes RSpec tests using the `rspec -f json` command and parses the
  JSON output to generate diagnostics for failed tests.
- Detects RSpec workspaces by looking for `Gemfile` or `.rspec` files.
- Includes a demo RSpec project (`demo/rspec_project`) for testing.
- Adds integration tests (`crates/adapter/tests/rspec_test.rs`)
  covering workspace detection, test discovery, and diagnostic parsing.

Cleanup and Fixes:
- I refactored the RSpec adapter to be fully synchronous, resolving previous
  compilation issues with the `Runner` trait.
- I removed unused imports and dead code in the RSpec adapter files.
- I ensured the `crates/adapter/src/runner/phpunit.rs` uses the correct
  tree-sitter PHP language function, confirming a previous fix.
- I verified that the entire project builds successfully using
  `cargo build --all-targets`.
- I confirmed all RSpec-specific tests pass. Pre-existing test failures
  in Jest, Node, and Vitest adapters remain and are noted as out of scope
  for this change.

The implementation adheres to the synchronous nature of the `Runner`
trait, ensuring correct integration with the existing adapter framework.
2025-05-24 14:52:56 +00:00
.github/workflows ci: update release procedure 2024-10-10 00:35:52 +09:00
.vim chore: update each settings for demo 2024-11-10 15:11:25 +09:00
crates/adapter feat: Add RSpec test adapter and perform project cleanup 2025-05-24 14:52:56 +00:00
demo feat: Add RSpec test adapter and perform project cleanup 2025-05-24 14:52:56 +00:00
doc docs: add documentation for adapter 2024-09-29 00:53:43 +09:00
src fix: avoid incremental syncing 2025-01-29 22:52:50 +09:00
.gitignore mvp 2024-05-07 00:08:27 +09:00
.testingls.toml feat: get configuration from toml file 2024-11-09 18:18:53 +09:00
Cargo.lock feat: Add RSpec test adapter and perform project cleanup 2025-05-24 14:52:56 +00:00
Cargo.toml chore: v0.1.12 2025-01-29 22:53:29 +09:00
CONTRIBUTING.md feat: implement phpunit adapter 2024-09-23 17:56:13 +09:00
justfile mvp 2024-05-07 00:08:27 +09:00
LICENSE add license 2024-06-30 22:39:44 +09:00
README.md docs: update README 2025-01-04 19:14:18 +09:00

testing-language-server

⚠️ IMPORTANT NOTICE This project is under active development and may introduce breaking changes. If you encounter any issues, please make sure to update to the latest version before reporting bugs.

General purpose LSP server that integrate with testing. The language server is characterized by portability and extensibility.

Motivation

This LSP server is heavily influenced by the following tools

These tools are very useful and powerful. However, they depend on the execution environment, such as VSCode and Neovim, and the portability aspect was inconvenient for me. So, I designed this testing-language-server and its dedicated adapters for each test tool to be the middle layer to the parts that depend on each editor.

This design makes it easy to view diagnostics from tests in any editor. Environment-dependent features like neotest and VSCode's built-in testing tools can also be achieved with minimal code using testing-language-server.

Instllation

cargo install testing-language-server
cargo install testing-ls-adapter

Features

Configuration

Required settings for all editors

You need to prepare .testingls.toml. See this for an example of the configuration.

enableWorkspaceDiagnostics = true

[adapterCommand.cargo-test]
path = "testing-ls-adapter"
extra_arg = ["--test-kind=cargo-test"]
include = ["/**/src/**/*.rs"]
exclude = ["/**/target/**"]

[adapterCommand.cargo-nextest]
path = "testing-ls-adapter"
extra_arg = ["--test-kind=cargo-nextest"]
include = ["/**/src/**/*.rs"]
exclude = ["/**/target/**"]

[adapterCommand.jest]
path = "testing-ls-adapter"
extra_arg = ["--test-kind=jest"]
include = ["/jest/*.js"]
exclude = ["/jest/**/node_modules/**/*"]

[adapterCommand.vitest]
path = "testing-ls-adapter"
extra_arg = ["--test-kind=vitest"]
include = ["/vitest/*.test.ts", "/vitest/config/**/*.test.ts"]
exclude = ["/vitest/**/node_modules/**/*"]

[adapterCommand.deno]
path = "testing-ls-adapter"
extra_arg = ["--test-kind=deno"]
include = ["/deno/*.ts"]
exclude = []

[adapterCommand.go]
path = "testing-ls-adapter"
extra_arg = ["--test-kind=go-test"]
include = ["/**/*.go"]
exclude = []

[adapterCommand.node-test]
path = "testing-ls-adapter"
extra_arg = ["--test-kind=node-test"]
include = ["/node-test/*.test.js"]
exclude = []

[adapterCommand.phpunit]
path = "testing-ls-adapter"
extra_arg = ["--test-kind=phpunit"]
include = ["/**/*Test.php"]
exclude = ["/phpunit/vendor/**/*.php"]

VSCode

Install from VSCode Marketplace. You can see the example in settings.json.

coc.nvim

Install from :CocInstall coc-testing-ls. You can see the example in See more example

Neovim (nvim-lspconfig)

See testing-ls.nvim

Helix

See language.toml.

The array wrapper has been removed to simplify the configuration structure. Please update your settings accordingly.

Adapter

  • cargo test
  • cargo nextest
  • jest
  • deno test
  • go test
  • phpunit
  • vitest
  • node --test (Node Test Runner)

Writing custom adapter

⚠ The specification of adapter CLI is not stabilized yet.

See ADAPTER_SPEC.md and spec.rs.