mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
Add test for LSP autoimport
This commit is contained in:
@@ -533,6 +533,7 @@ function! ale#completion#ParseLSPCompletions(response) abort
|
||||
|
||||
if has_key(l:item, 'additionalTextEdits')
|
||||
let l:text_changes = []
|
||||
|
||||
for l:edit in l:item.additionalTextEdits
|
||||
let l:range = l:edit.range
|
||||
call add(l:text_changes, {
|
||||
@@ -549,7 +550,7 @@ function! ale#completion#ParseLSPCompletions(response) abort
|
||||
endfor
|
||||
|
||||
let l:changes = [{
|
||||
\ 'fileName': expand('%:p'),
|
||||
\ 'fileName': expand('#' . l:buffer . ':p'),
|
||||
\ 'textChanges': l:text_changes,
|
||||
\}]
|
||||
\
|
||||
|
||||
@@ -90,8 +90,9 @@ function! s:getChanges(workspace_edit) abort
|
||||
return a:workspace_edit.changes
|
||||
elseif has_key(a:workspace_edit, 'documentChanges')
|
||||
let l:document_changes = []
|
||||
if type(a:workspace_edit.documentChanges) is v:t_dict &&
|
||||
\ has_key(a:workspace_edit.documentChanges, 'edits')
|
||||
|
||||
if type(a:workspace_edit.documentChanges) is v:t_dict
|
||||
\ && has_key(a:workspace_edit.documentChanges, 'edits')
|
||||
call add(l:document_changes, a:workspace_edit.documentChanges)
|
||||
elseif type(a:workspace_edit.documentChanges) is v:t_list
|
||||
let l:document_changes = a:workspace_edit.documentChanges
|
||||
|
||||
Reference in New Issue
Block a user