Language server for real-time testing diagnostics
Find a file
2024-10-19 16:57:56 +09:00
.github/workflows ci: update release procedure 2024-10-10 00:35:52 +09:00
.vim chore: update specification 2024-10-13 23:41:51 +09:00
crates/adapter fix(adapter): support nested namespace definition 2024-10-19 16:50:52 +09:00
demo chore(demo): update vscode settings 2024-10-19 16:57:56 +09:00
doc docs: add documentation for adapter 2024-09-29 00:53:43 +09:00
src fix: handle shutdown correctly according to specification 2024-10-14 21:45:50 +09:00
.gitignore mvp 2024-05-07 00:08:27 +09:00
Cargo.lock chore: update version 2024-10-14 21:47:16 +09:00
Cargo.toml chore: update version 2024-10-14 21:47:16 +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 2024-10-14 00:00:56 +09:00

testing-language-server

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

language server config:

"languageserver": {
  "testing": {
    "command": "<server path>/testing-language-server",
    "trace.server": "verbose",
    "filetypes": [
      "rust",
      "javascript"
    ],
    "initializationOptions": {
      "initializationOptions": {
        "adapterCommand": {
          "cargo test": [
            {
              "path": "<adapter path>/testing-ls-adapter",
              "extra_arg": ["--test-kind=cargo-test"],
              "include": ["**/*.rs"],
              "exclude": ["**/target/**"]
            }
          ],
          "jest": [
            {
              "path": "<adapter path>/testing-ls-adapter",
              "extra_arg": ["--test-kind=jest"],
              "include": ["/**/*.js"],
              "exclude": ["/node_modules/**/*"]
            }
          ]
        }
      }
    }
  }
}

See more example

Adapter

  • cargo test
  • cargo nextest
  • jest
  • deno test
  • go test
  • phpunit
  • vitest

Writing custom adapter

⚠ The specification of adapter CLI is not stabilized yet.

See SPEC.md and spec.rs.