summaryrefslogtreecommitdiff
path: root/rplugin/python3/deoplete/sources/ale.py
diff options
context:
space:
mode:
Diffstat (limited to 'rplugin/python3/deoplete/sources/ale.py')
-rw-r--r--rplugin/python3/deoplete/sources/ale.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/rplugin/python3/deoplete/sources/ale.py b/rplugin/python3/deoplete/sources/ale.py
index 3955ed2d..ae1f4039 100644
--- a/rplugin/python3/deoplete/sources/ale.py
+++ b/rplugin/python3/deoplete/sources/ale.py
@@ -24,6 +24,7 @@ class Source(Base):
self.rank = 1000
self.is_bytepos = True
self.min_pattern_length = 1
+ self.is_volatile = True
# Do not forget to update s:trigger_character_map in completion.vim in
# updating entries in this map.
self.input_patterns = {
@@ -44,21 +45,16 @@ class Source(Base):
if not self.vim.call('ale#completion#CanProvideCompletions'):
return None
- if context.get('is_refresh'):
- context['is_async'] = False
+ event = context.get('event')
- if context['is_async']:
- # Result is the same as for omnifunc, or None.
+ if event == 'Async':
result = self.vim.call('ale#completion#GetCompletionResult')
+ return result or []
- if result is not None:
- context['is_async'] = False
-
- return result
- else:
- context['is_async'] = True
-
- # Request some completion results.
- self.vim.call('ale#completion#GetCompletions', 'deoplete')
+ if context.get('is_refresh'):
+ self.vim.command(
+ "call ale#completion#GetCompletions('ale-callback', " + \
+ "{'callback': {completions -> deoplete#auto_complete() }})"
+ )
return []