mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
add lsp_server_exit notification (#980)
This commit is contained in:
@@ -761,6 +761,8 @@ function! s:on_exit(server_name, id, data, event) abort
|
||||
if has_key(l:server, 'init_result')
|
||||
unlet l:server['init_result']
|
||||
endif
|
||||
call lsp#stream(1, { 'server': '$vimlsp',
|
||||
\ 'response': { 'method': '$/vimlsp/lsp_server_exit', 'params': { 'server': a:server_name } } })
|
||||
doautocmd <nomodeline> User lsp_server_exit
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1097,6 +1097,24 @@ au User lsp_setup call lsp#callbag#pipe(
|
||||
\ )
|
||||
<
|
||||
|
||||
Custom vim-lsp notifications streams:
|
||||
vimp-lsp events mimic lsp server notifications.
|
||||
* `server` is always `$vimlsp`.
|
||||
* `response` `method` is always prefixed with ``$/vimlsp/`
|
||||
|
||||
|
||||
|$/vimlsp/lsp_server_exit|
|
||||
This is similar to |lsp_server_exit| autocommand.
|
||||
|
||||
Example: >
|
||||
{
|
||||
"server": "$vimlsp",
|
||||
"response": {
|
||||
"method": "$/vimlsp/lsp_server_exit",
|
||||
"params": { "server": "$vimlsp" }
|
||||
}
|
||||
}
|
||||
<
|
||||
lsp#stop_server({name-of-server}) *lsp#stop_server()*
|
||||
|
||||
Used to stop the server.
|
||||
|
||||
Reference in New Issue
Block a user