diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-10-25 14:23:57 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2024-10-25 14:23:57 +0200 |
| commit | 62e6a847a85e25037a4a7fbcd4af697928d5ecfc (patch) | |
| tree | 3993fdc9f7becc4f75c20226ac53493e1fef3abb /init.lua | |
| parent | c4e6e66ec82a2d82d24d2329a6fd8295c4682468 (diff) | |
| download | vis-lspc-62e6a847a85e25037a4a7fbcd4af697928d5ecfc.tar.gz vis-lspc-62e6a847a85e25037a4a7fbcd4af697928d5ecfc.zip | |
attempt a gracefully shutdown the language servers when vis quits
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1745,6 +1745,17 @@ vis.events.subscribe(lspc.events.LS_INITIALIZED, function(ls) end end) +vis.events.subscribe(vis.events.QUIT, function() + for _, ls in pairs(lspc.running) do + -- attempt to gracefully shutdown the language server + ls:shutdown() + -- close the fd handle to terminate the subprocess because + -- a potential method response from the server will not be read after the + -- QUIT event + ls.fd:close() + end +end) + vis:option_register('lspc-highlight-diagnostics', 'string', function(value) lspc.highlight_diagnostics = value return true |
