mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2026-06-09 15:37:30 +02:00
Always pass response for is_error function (#86)
This commit is contained in:
@@ -227,8 +227,8 @@ function! s:lsp_get_last_request_id(id) abort
|
||||
return s:clients[a:id]['request_sequence']
|
||||
endfunction
|
||||
|
||||
function! s:lsp_is_error(notification) abort
|
||||
return has_key(a:notification, 'error')
|
||||
function! s:lsp_is_error(obj_or_response) abort
|
||||
return has_key(a:obj_or_response, 'error')
|
||||
endfunction
|
||||
|
||||
function! s:is_server_instantiated_notification(notification) abort
|
||||
@@ -257,8 +257,8 @@ function! lsp#client#get_last_request_id(client_id) abort
|
||||
return s:lsp_get_last_request_id(a:client_id)
|
||||
endfunction
|
||||
|
||||
function! lsp#client#is_error(notification) abort
|
||||
return s:lsp_is_error(a:notification)
|
||||
function! lsp#client#is_error(obj_or_response) abort
|
||||
return s:lsp_is_error(a:obj_or_response)
|
||||
endfunction
|
||||
|
||||
function! lsp#client#is_server_instantiated_notification(notification) abort
|
||||
|
||||
@@ -282,7 +282,7 @@ function! s:handle_symbol(server, last_req_id, type, data) abort
|
||||
return
|
||||
endif
|
||||
|
||||
if lsp#client#is_error(a:data)
|
||||
if lsp#client#is_error(a:data['response'])
|
||||
call s:error_msg('Failed to retrieve '. a:type . ' for ' . a:server)
|
||||
return
|
||||
endif
|
||||
@@ -306,7 +306,7 @@ function! s:handle_location(ctx, server, type, data) abort "ctx = {counter, list
|
||||
|
||||
let a:ctx['counter'] = a:ctx['counter'] - 1
|
||||
|
||||
if lsp#client#is_error(a:data)
|
||||
if lsp#client#is_error(a:data['response'])
|
||||
call s:error_msg('Failed to retrieve '. a:type . ' for ' . a:server)
|
||||
else
|
||||
let a:ctx['list'] = a:ctx['list'] + lsp#ui#vim#utils#locations_to_loc_list(a:data)
|
||||
@@ -337,7 +337,7 @@ function! s:handle_hover(server, last_req_id, type, data) abort
|
||||
return
|
||||
endif
|
||||
|
||||
if lsp#client#is_error(a:data)
|
||||
if lsp#client#is_error(a:data['response'])
|
||||
call s:error_msg('Failed to retrieve '. a:type . ' for ' . a:server)
|
||||
return
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user