Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tsserver not returning details for items with empty source #2845

Merged
merged 1 commit into from
Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions autoload/ale/completion.vim
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,17 @@ function! ale#completion#HandleTSServerResponse(conn_id, response) abort
let l:identifiers = []

for l:name in l:names
call add(l:identifiers, {
let l:identifier = {
\ '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

let b:ale_completion_info.request_id = ale#lsp#Send(
Expand Down
2 changes: 0 additions & 2 deletions test/completion/test_lsp_completion_messages.vader
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,8 @@ Execute(The right message sent to the tsserver LSP when the first completion mes
\ 'source': '/path/to/foo.ts',
\ }, {
\ 'name': 'FooBar',
\ 'source': '',
\ }, {
\ 'name': 'frazzle',
\ 'source': '',
\ }],
\ 'offset': 1,
\ 'line': 1,
Expand Down