Skip to content

Commit 6894fb9

Browse files
mattnprabirshrestha
authored andcommitted
Fix lsp_is_error (#238)
* Fix lsp_is_error * Add missing return 0, use elseif. * Use spaces
1 parent 9c327af commit 6894fb9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

autoload/lsp/client.vim

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,13 @@ function! s:lsp_get_last_request_id(id) abort
243243
endfunction
244244

245245
function! s:lsp_is_error(obj_or_response) abort
246-
return has_key(a:obj_or_response, 'error')
247-
endfunction
248-
249-
function! s:lsp_is_error(obj_or_response) abort
250-
return has_key(a:obj_or_response, 'error')
246+
let vt = type(a:obj_or_response)
247+
if vt == type('')
248+
return len(a:obj_or_response) > 0
249+
elseif vt == type({})
250+
return has_key(a:obj_or_response, 'error')
251+
endif
252+
return 0
251253
endfunction
252254

253255

0 commit comments

Comments
 (0)