Crates.io | testing-language-server |
lib.rs | testing-language-server |
version | 0.0.3 |
source | src |
created_at | 2024-05-23 14:26:17.71436 |
updated_at | 2024-06-22 11:06:58.837253 |
description | LSP server for testing |
homepage | |
repository | |
max_upload_size | |
id | 1249564 |
size | 187,596 |
General purpose LSP server that integrate with testing. The language server is characterized by portability and extensibility.
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.
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_args": ["--test-kind=cargo-test"],
"include_pattern": ["**/*.rs"],
"exclude_pattern": ["**/target/**"]
}
],
"jest": [
{
"path": "<adapter path>/testing-ls-adapter",
"extra_args": ["--test-kind=jest"],
"include_patterns": ["/**/*.js"],
"exclude_patterns": ["/node_modules/**/*"]
}
]
}
}
}
}
}
⚠ The specification of adapter CLI is not stabilized yet.
See spec.rs.
clap crate makes it easy to address specification, but in principle you can create an adapter in any way you like, regardless of the language you implement.