mirror of https://github.com/dense-analysis/ale
Fix tsserver not returning details for items with empty source
This commit is contained in:
parent
dfe9b7cc26
commit
8698c44e2a
|
@ -492,10 +492,17 @@ function! ale#completion#HandleTSServerResponse(conn_id, response) abort
|
||||||
let l:identifiers = []
|
let l:identifiers = []
|
||||||
|
|
||||||
for l:name in l:names
|
for l:name in l:names
|
||||||
call add(l:identifiers, {
|
let l:identifier = {
|
||||||
\ 'name': l:name.word,
|
\ 'name': l:name.word,
|
||||||
\ 'source': get(l:name, 'source', ''),
|
\}
|
||||||
\})
|
let l:source = get(l:name, 'source', '')
|
||||||
|
|
||||||
|
" Empty source results in no details for the completed item
|
||||||
|
if !empty(l:source)
|
||||||
|
call extend(l:identifier, { 'source': l:source })
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:identifiers, l:identifier)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
let b:ale_completion_info.request_id = ale#lsp#Send(
|
let b:ale_completion_info.request_id = ale#lsp#Send(
|
||||||
|
|
|
@ -190,10 +190,8 @@ Execute(The right message sent to the tsserver LSP when the first completion mes
|
||||||
\ 'source': '/path/to/foo.ts',
|
\ 'source': '/path/to/foo.ts',
|
||||||
\ }, {
|
\ }, {
|
||||||
\ 'name': 'FooBar',
|
\ 'name': 'FooBar',
|
||||||
\ 'source': '',
|
|
||||||
\ }, {
|
\ }, {
|
||||||
\ 'name': 'frazzle',
|
\ 'name': 'frazzle',
|
||||||
\ 'source': '',
|
|
||||||
\ }],
|
\ }],
|
||||||
\ 'offset': 1,
|
\ 'offset': 1,
|
||||||
\ 'line': 1,
|
\ 'line': 1,
|
||||||
|
|
Loading…
Reference in New Issue