mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 21:12:31 +08:00
Add asyncomplete.vim Support (#2627)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user