From 0cb432cb825e80c5a6f6dc9bc9c52a38f9b45319 Mon Sep 17 00:00:00 2001 From: Jerko Steiner Date: Wed, 1 Jan 2020 20:00:41 +0100 Subject: Add TypeScript autoimport support for deoplete (#2779) * Add autoimport support for deoplete * Fix test_deoplete_source.py * Use callback instead of is_async for deoplete Shuogo, the author of Deoplete, does not recommend using the `is_async` option: > I think is_async is not recommended. It is not so useful and broken. > You should use callback system instead. Link: https://github.com/Shougo/deoplete.nvim/issues/1006#issuecomment-526797857 Incidentally, the same thread mentiones an issue started by w0rp: https://github.com/Shougo/deoplete.nvim/issues/976 The deoplete docs also say is_async is deprecated: > is_async (Bool) > If the gather is asynchronous, the source must set > it to "True". A typical strategy for an asynchronous > gather_candidates method to use this flag is to > set is_async flag to True while results are being > produced in the background (optionally, returning them > as they become ready). Once background processing > has completed, is_async flag should be set to False > indicating that this is the last portion of the > candidates. > > Note: The feature is deprecated and not recommended. > You should use callback system by > |deoplete#auto_complete()| instead. Link: https://github.com/Shougo/deoplete.nvim/blob/master/doc/deoplete.txt Co-authored-by: w0rp --- test/completion/test_completion_events.vader | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/completion') diff --git a/test/completion/test_completion_events.vader b/test/completion/test_completion_events.vader index d70fefeb..2ac2b15c 100644 --- a/test/completion/test_completion_events.vader +++ b/test/completion/test_completion_events.vader @@ -233,7 +233,7 @@ Execute(ale#completion#Show() should make the correct feedkeys() call for manual AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls Execute(ale#completion#Show() should not call feedkeys() for other sources): - let b:ale_completion_info = {'source': 'deoplete'} + let b:ale_completion_info = {'source': 'other-source'} call ale#completion#Show([{'word': 'x', 'kind': 'v', 'icase': 1}]) sleep 1ms @@ -334,7 +334,7 @@ Execute(b:ale_completion_info should be set up correctly when requesting complet Execute(b:ale_completion_info should be set up correctly for other sources): let b:ale_completion_result = [] call setpos('.', [bufnr(''), 3, 14, 0]) - call ale#completion#GetCompletions('deoplete') + call ale#completion#GetCompletions('ale-callback') AssertEqual \ { @@ -344,7 +344,7 @@ Execute(b:ale_completion_info should be set up correctly for other sources): \ 'line_length': 14, \ 'line': 3, \ 'prefix': 'ab', - \ 'source': 'deoplete', + \ 'source': 'ale-callback', \ }, \ b:ale_completion_info Assert !exists('b:ale_completion_result') -- cgit v1.2.3