From b27df1b169cabb12e94b102cd8b6a788b2c864b2 Mon Sep 17 00:00:00 2001 From: Donnie West Date: Thu, 17 Oct 2019 21:47:07 -0500 Subject: Allow code actions to work on callback based sources --- autoload/ale/completion.vim | 2 +- test/completion/test_completion_events.vader | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim index a15ca514..63e2247c 100644 --- a/autoload/ale/completion.vim +++ b/autoload/ale/completion.vim @@ -722,7 +722,7 @@ endfunction function! ale#completion#HandleUserData(completed_item) abort let l:source = get(get(b:, 'ale_completion_info', {}), 'source', '') - if l:source isnot# 'ale-automatic' && l:source isnot# 'ale-manual' + if l:source isnot# 'ale-automatic' && l:source isnot# 'ale-manual' && l:source isnot# 'ale-callback' return endif diff --git a/test/completion/test_completion_events.vader b/test/completion/test_completion_events.vader index e06ac98b..d70fefeb 100644 --- a/test/completion/test_completion_events.vader +++ b/test/completion/test_completion_events.vader @@ -431,6 +431,12 @@ Execute(HandleUserData should call ale#code_action#HandleCodeAction): \}) AssertEqual g:handle_code_action_called, 2 + let b:ale_completion_info = {'source': 'ale-callback'} + call ale#completion#HandleUserData({ + \ 'user_data': '{"codeActions": [{"description":"", "changes": []}]}' + \}) + AssertEqual g:handle_code_action_called, 3 + Execute(ale#code_action#HandleCodeAction should not be called when when source is not ALE): call MockHandleCodeAction() let b:ale_completion_info = {'source': 'syntastic'} -- cgit v1.2.3