Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Commit

Permalink
Add a better warning for not finding definition
Browse files Browse the repository at this point in the history
  • Loading branch information
tjdevries committed Nov 26, 2016
1 parent 8bf321c commit 4474a3a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions autoload/langserver/goto.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ function! langserver#goto#callback(id, data, event) abort
endif

if has_key(a:data, 'response')
if empty(a:data['response']['result'])
call langserver#log#log('warning', 'No definition found for: ' . string(a:data['request']), v:true)
return
endif

if type(a:data['response']['result']) == type([])
let l:parsed_data = a:data['response']['result'][0]
elseif type(a:data['response']['result']) == type({})
" Check if we have an empty dictionary
if empty(a:data['response']['result'])
call langserver#log#log('warning', 'No definition found for: ' . string(a:data['request']), v:true)
return
else
let l:parsed_data = a:data['response']['result']
endif
let l:parsed_data = a:data['response']['result']
endif
else
return
Expand Down

0 comments on commit 4474a3a

Please sign in to comment.