Skip to content

Commit

Permalink
#2492 - Try to fix a bug with ALE's deoplete source
Browse files Browse the repository at this point in the history
  • Loading branch information
w0rp committed May 11, 2019
1 parent 79e42fe commit f0152bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rplugin/python3/deoplete/sources/ale.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ def gather_candidates(self, context):
# Request some completion results.
self.vim.call('ale#completion#GetCompletions', 'deoplete')

return []
return None
8 changes: 4 additions & 4 deletions test/python/test_deoplete_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_completion_position(self):
def test_request_completion_results(self):
context = {'is_async': False}

self.assertEqual(self.source.gather_candidates(context), [])
self.assertIsNone(self.source.gather_candidates(context))
self.assertEqual(context, {'is_async': True})
self.assertEqual(self.call_list, [
('ale#completion#GetCompletions', ('deoplete',)),
Expand All @@ -68,15 +68,15 @@ def test_request_completion_results(self):
def test_refresh_completion_results(self):
context = {'is_async': False}

self.assertEqual(self.source.gather_candidates(context), [])
self.assertIsNone(self.source.gather_candidates(context))
self.assertEqual(context, {'is_async': True})
self.assertEqual(self.call_list, [
('ale#completion#GetCompletions', ('deoplete',)),
])

context = {'is_async': True, 'is_refresh': True}

self.assertEqual(self.source.gather_candidates(context), [])
self.assertIsNone(self.source.gather_candidates(context))
self.assertEqual(context, {'is_async': True, 'is_refresh': True})
self.assertEqual(self.call_list, [
('ale#completion#GetCompletions', ('deoplete',)),
Expand All @@ -87,7 +87,7 @@ def test_poll_no_result(self):
context = {'is_async': True}
self.call_results['ale#completion#GetCompletionResult'] = None

self.assertEqual(self.source.gather_candidates(context), [])
self.assertIsNone(self.source.gather_candidates(context))
self.assertEqual(context, {'is_async': True})
self.assertEqual(self.call_list, [
('ale#completion#GetCompletionResult', ()),
Expand Down

0 comments on commit f0152bc

Please sign in to comment.