mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 20:54:26 +08:00
#1751 Handle LSP completion results without the 'kind' attribute
This commit is contained in:
@@ -336,7 +336,9 @@ function! ale#completion#ParseLSPCompletions(response) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" See :help complete-items for Vim completion kinds
|
" See :help complete-items for Vim completion kinds
|
||||||
if l:item.kind is s:LSP_COMPLETION_METHOD_KIND
|
if !has_key(l:item, 'kind')
|
||||||
|
let l:kind = 'v'
|
||||||
|
elseif l:item.kind is s:LSP_COMPLETION_METHOD_KIND
|
||||||
let l:kind = 'm'
|
let l:kind = 'm'
|
||||||
elseif l:item.kind is s:LSP_COMPLETION_CONSTRUCTOR_KIND
|
elseif l:item.kind is s:LSP_COMPLETION_CONSTRUCTOR_KIND
|
||||||
let l:kind = 'm'
|
let l:kind = 'm'
|
||||||
|
|||||||
@@ -430,10 +430,10 @@ Execute(Should handle Python completion results correctly):
|
|||||||
\ }
|
\ }
|
||||||
\ })
|
\ })
|
||||||
|
|
||||||
Execute(Should handle missing detail keys):
|
Execute(Should handle missing keys):
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ [
|
\ [
|
||||||
\ {'word': 'x', 'menu': '', 'info': 'y', 'kind': 'f', 'icase': 1},
|
\ {'word': 'x', 'menu': '', 'info': '', 'kind': 'v', 'icase': 1},
|
||||||
\ ],
|
\ ],
|
||||||
\ ale#completion#ParseLSPCompletions({
|
\ ale#completion#ParseLSPCompletions({
|
||||||
\ 'jsonrpc': '2.0',
|
\ 'jsonrpc': '2.0',
|
||||||
@@ -443,8 +443,6 @@ Execute(Should handle missing detail keys):
|
|||||||
\ 'items': [
|
\ 'items': [
|
||||||
\ {
|
\ {
|
||||||
\ 'label': 'x',
|
\ 'label': 'x',
|
||||||
\ 'kind': 3,
|
|
||||||
\ 'documentation': 'y',
|
|
||||||
\ },
|
\ },
|
||||||
\ ]
|
\ ]
|
||||||
\ }
|
\ }
|
||||||
|
|||||||
Reference in New Issue
Block a user