File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -448,7 +448,13 @@ function! lsp#client#send_response(client_id, opts) abort
448448 if has_key (a: opts , ' id' ) | let l: request [' id' ] = a: opts [' id' ] | endif
449449 if has_key (a: opts , ' result' ) | let l: request [' result' ] = a: opts [' result' ] | endif
450450 if has_key (a: opts , ' error' ) | let l: request [' error' ] = a: opts [' error' ] | endif
451- call ch_sendexpr (l: ctx [' channel' ], l: request )
451+ try
452+ call ch_sendexpr (l: ctx [' channel' ], l: request )
453+ catch
454+ " vim only supports id as number and fails when string, hence add a try catch: https://github.com/vim/vim/issues/14091
455+ call lsp#log (' lsp#client#send_response error' , v: exception , v: throwpoint ,
456+ \ has_key (l: request , ' id' ) && type (l: request [' id' ]) != type (1 ))
457+ endtry
452458 return 0
453459 else
454460 return s: lsp_send (a: client_id , a: opts , s: send_type_response )
You can’t perform that action at this time.
0 commit comments