Fix #1816 - Fix a type error in the initialize message handler

This commit is contained in:
w0rp 2018-08-16 14:19:12 +01:00
parent 1a4456cf2a
commit 277313b58d
No known key found for this signature in database
GPG Key ID: 0FC1ECAA8C81CD83
2 changed files with 9 additions and 1 deletions

View File

@ -256,7 +256,8 @@ function! ale#lsp#HandleOtherInitializeResponses(conn, response) abort
endif endif
if get(a:response, 'method', '') is# '' if get(a:response, 'method', '') is# ''
if has_key(get(a:response, 'result', {}), 'capabilities') if type(get(a:response, 'result')) is v:t_dict
\&& has_key(a:response.result, 'capabilities')
call s:UpdateCapabilities(a:conn, a:response.result.capabilities) call s:UpdateCapabilities(a:conn, a:response.result.capabilities)
for [l:dir, l:project] in l:uninitialized_projects for [l:dir, l:project] in l:uninitialized_projects

View File

@ -181,3 +181,10 @@ Execute(Disabled capabilities should be recognised correctly):
\ }, \ },
\ }, \ },
\ b:conn \ b:conn
Execute(Results that are not dictionaries should be handled correctly):
call ale#lsp#HandleOtherInitializeResponses(b:conn, {
\ 'jsonrpc': '2.0',
\ 'id': 1,
\ 'result': v:null,
\})