Add asyncomplete.vim Support (#2627)

This commit is contained in:
Donnie West
2019-08-17 12:40:05 -05:00
committed by w0rp
parent 28c93ab185
commit 5388ff1d54
4 changed files with 90 additions and 3 deletions

View File

@@ -62,6 +62,10 @@ After:
delfunction CheckCompletionCalled
if exists('*CompleteCallback')
delfunction CompleteCallback
endif
" Stop any timers we left behind.
" This stops the tests from failing randomly.
call ale#completion#StopTimer()
@@ -333,6 +337,30 @@ Execute(b:ale_completion_info should be set up correctly for other sources):
\ b:ale_completion_info
Assert !exists('b:ale_completion_result')
Execute(b:ale_completion_info should be set up correctly when requesting completions via callback):
let b:ale_completion_result = []
call setpos('.', [bufnr(''), 3, 14, 0])
function! CompleteCallback() abort
echo 'Called'
endfunction
call ale#completion#GetCompletions('ale-callback', {'callback': funcref('CompleteCallback')})
AssertEqual
\ {
\ 'request_id': 0,
\ 'conn_id': 0,
\ 'column': 14,
\ 'line_length': 14,
\ 'line': 3,
\ 'prefix': 'ab',
\ 'source': 'ale-callback',
\ },
\ b:ale_completion_info
Assert !exists('b:ale_completion_result')
Execute(The correct keybinds should be configured):
redir => g:output
silent map <Plug>(ale_show_completion_menu)