Wrapper around the OCaml lsp library to make it easier to write LSP servers
Find a file
Anton Sorokin 09311ae258 [#22] Threat shutdown and exit requests correctly
Problem:
As in [#22], we want to shut down our LSP server correctly.
That means we should close the pipe and end process after an exit request.
This require proper `shutdown : unit -> bool` function passed
to `Jsonrpc2.Make.run` which returns `true` after
the server received an exit request.

Right now both exit and shutdown requests are setting
LSP server's internal var `_quit` to true. It's very intuitive to
use this var in `shutdown`, but we can't do it, since in this case
the server would stop receiving new messages right after the
shutdown request, despite the fact  according to the LSP specification
it had to wait the exit request.

Solution:
Instead of `_quit : bool` use
```
status : [ `Running | `ReceivedShutdown | `ReceivedExit ]
```
and suggest
```
shutdown () = s#get_status = `ReceivedExit
```
in docs for `Jsonrpc2.Make.run` and in the templete/example.
2023-08-04 09:31:23 -04:00
.github/workflows ci 2022-05-01 10:07:59 -04:00
example/template [#22] Threat shutdown and exit requests correctly 2023-08-04 09:31:23 -04:00
src [#22] Threat shutdown and exit requests correctly 2023-08-04 09:31:23 -04:00
.gitignore gitignore 2023-03-10 22:44:11 -05:00
.ocamlformat add ocamlformat 2023-03-10 23:12:29 -05:00
dune-project refactor: split into lwt server and abstract interface 2021-02-09 19:40:31 -05:00
linol-lwt.opam opam 2023-03-11 00:05:04 -05:00
linol.opam move to lsp 1.14 2023-03-10 23:12:13 -05:00
Makefile prepare for 0.3 2021-05-05 13:44:09 -04:00
README.md doc: build badge in readme 2021-03-25 17:36:42 -04:00

Linol build

This is a wrapper around the lsp library, which provides base types for the protocol. Linol ("linol is not ocaml-lsp") provides an object abstraction so that users can override only the methods they provide, and a Lwt implementation of the jsonrpc wire protocol.

License

MIT license.