1
1
mirror of https://github.com/tweag/nickel.git synced 2024-10-05 23:57:09 +03:00
nickel/lsp/lsp-harness
2024-03-12 14:34:58 +00:00
..
src Improve document symbols (#1848) 2024-03-12 14:34:58 +00:00
Cargo.toml Add nls benchmarks (#1659) 2023-10-03 21:31:40 +00:00
README.md Specify the test harness requests as toml instead of a custom format (#1424) 2023-06-30 18:46:41 +00:00

lsp-harness

This is a testing harness for language servers, together with some snapshot tests for nls.

The snapshot format

Each snapshot test loads one or more files into nls, then runs one or more requests and checks that the responses are as expected. The input files are divided up into chunks delimited by lines starting with ###. Each chunk between these lines consists of the contents of a file to be loaded into the language server, and the line before the chunk specifies the name of that file (which must be an absolute path).

The input file may end with a block of lines starting with ###. If it does, these lines specify a list of requests to send to the language server. These requests are written as LSP requests translated to toml.

For example, a test file might look like:

### /absolute/path.ncl
<contents of /absolute/path.ncl>
### /another/absolute/path.ncl
<contents of /another/absolute/path.ncl>
### [[request]]
### type = "GotoDefinition"
### textDocument.uri = "file:///absolute/path.ncl"
### position = { line = 3, character = 8 }