Commit graph

7 commits

Author SHA1 Message Date
Nick Hu
2b02a94eba Implement Eio backend 2024-05-22 10:19:03 -04:00
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
Simon Cruanes
c6969ab87c
api break: put spawn in the server itself, not IO 2023-08-02 14:25:07 -04:00
Simon Cruanes
e9cc94dc14
autoformat 2023-03-10 23:12:41 -05:00
Simon Cruanes
6d9d2e51e3 refactor: give notify_back to requests, too 2021-04-07 18:01:37 -04:00
Simon Cruanes
fc17e1e59b big refactor: jsonrpc2 is now part of linol; provide blocking IO 2021-03-25 17:09:03 -04:00
Guillaume Bury
ef305cddd5 Add a template example to make linol easier to use 2021-02-17 01:04:07 +01:00