mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-24 12:14:32 +01:00
add lsp#notification() for proper $/cancel support (#1079)
This commit is contained in:
@@ -1036,7 +1036,7 @@ function! s:request_cancel(ctx) abort
|
|||||||
if lsp#get_server_status(a:ctx['server_name']) !=# 'running' | return | endif " if server is not running we cant send the request
|
if lsp#get_server_status(a:ctx['server_name']) !=# 'running' | return | endif " if server is not running we cant send the request
|
||||||
" send the actual cancel request
|
" send the actual cancel request
|
||||||
let a:ctx['dispose'] = lsp#callbag#pipe(
|
let a:ctx['dispose'] = lsp#callbag#pipe(
|
||||||
\ lsp#request(a:ctx['server_name'], {
|
\ lsp#notification(a:ctx['server_name'], {
|
||||||
\ 'method': '$/cancelRequest',
|
\ 'method': '$/cancelRequest',
|
||||||
\ 'params': { 'id': a:ctx['request_id'] },
|
\ 'params': { 'id': a:ctx['request_id'] },
|
||||||
\ }),
|
\ }),
|
||||||
@@ -1076,6 +1076,12 @@ function! s:send_request_error(ctx, error) abort
|
|||||||
endfunction
|
endfunction
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
" lsp#notification {{{
|
||||||
|
function! lsp#notification(server_name, request) abort
|
||||||
|
return lsp#callbag#lazy(function('s:send_notification', [a:server_name, a:request]))
|
||||||
|
endfunction
|
||||||
|
" }}}
|
||||||
|
|
||||||
" omnicompletion
|
" omnicompletion
|
||||||
function! lsp#complete(...) abort
|
function! lsp#complete(...) abort
|
||||||
return call('lsp#omni#complete', a:000)
|
return call('lsp#omni#complete', a:000)
|
||||||
|
|||||||
Reference in New Issue
Block a user