Skip to content

Commit 0a8d2df

Browse files
cootprabirshrestha
andauthored
Prepare call hierarchy (#1388)
The response ought to be a list, although haskell language server replies with a null at times. Co-authored-by: Prabir Shrestha <[email protected]>
1 parent f453d6c commit 0a8d2df

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

autoload/lsp/ui/vim.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ function! s:handle_prepare_call_hierarchy(ctx, server, type, data) abort
413413
call lsp#utils#error('Failed to '. a:type . ' for ' . a:server . ': ' . lsp#client#error_message(a:data['response']))
414414
return
415415
endif
416+
if empty(a:data['response']['result'])
417+
call lsp#utils#warning('Failed to '. a:type . ' for ' . a:server . ': ' . lsp#client#error_message(a:data['response']))
418+
return
419+
endif
416420

417421
for l:item in a:data['response']['result']
418422
call s:call_hierarchy(a:ctx, a:server, l:item)

autoload/lsp/utils.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,13 @@ function! lsp#utils#error(msg) abort
283283
echohl NONE
284284
endfunction
285285

286+
function! lsp#utils#warning(msg) abort
287+
echohl WarningMsg
288+
echom a:msg
289+
echohl NONE
290+
endfunction
291+
292+
286293
function! lsp#utils#echo_with_truncation(msg) abort
287294
let l:msg = a:msg
288295

0 commit comments

Comments
 (0)