docs: update README

This commit is contained in:
kbwo 2024-10-14 00:00:56 +09:00
parent 3d01eef6b1
commit 54c3ca3e29
2 changed files with 47 additions and 4 deletions

View file

@ -10,7 +10,7 @@ This LSP server is heavily influenced by the following tools
- [neotest](https://github.com/nvim-neotest/neotest)
- [Wallaby.js](https://wallabyjs.com)
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.
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.
@ -25,11 +25,11 @@ cargo install testing-ls-adapter
## Features
- [x] Realtime testing diagnostics
- [ ] More efficient checking of diagnostics
- [ ] Adapter installation command
- [x] [VSCode extension](https://github.com/kbwo/vscode-testing-ls)
- [x] [Coc.nvim extension](https://github.com/kbwo/coc-testing-ls)
- [ ] NeoVim builtin LSP plugin
- [x] For Neovim builtin LSP, see [demo/README.md](./demo/README.md)
- [ ] More efficient checking of diagnostics
- [ ] Useful commands in each extension
## Configuration

43
demo/README.md Normal file
View file

@ -0,0 +1,43 @@
## Using `nvim-lspconfig`
The specification is not stable, so you need to set it yourself. Once the spec is stable, I will send a PR to `nvim-lspconfig`.
```
local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')
local util = require "lspconfig/util"
configs.testing_ls = {
default_config = {
cmd = { "testing-language-server" },
filetypes = { "rust" },
root_dir = util.root_pattern(".git", "Cargo.toml"),
init_options = {
enable = true,
fileTypes = {"rust"},
adapterCommand = {
rust = {
{
path = "testing-ls-adapter",
extra_arg = { "--test-kind=cargo-test", "--workspace" },
include = { "/demo/**/src/**/*.rs"},
exclude = { "/**/target/**"},
}
}
},
enableWorkspaceDiagnostics = true,
trace = {
server = "verbose"
}
}
},
docs = {
description = [[
https://github.com/kbwo/testing-language-server
Language Server for real-time testing.
]],
},
}
lspconfig.testing_ls.setup{}
```