mirror of
https://github.com/c-cube/linol.git
synced 2025-12-06 03:05:31 -05:00
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. |
||
|---|---|---|
| .. | ||
| template | ||