mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 05:24:46 +08:00
Allow code actions to work on callback based sources
This commit is contained in:
@@ -722,7 +722,7 @@ endfunction
|
|||||||
function! ale#completion#HandleUserData(completed_item) abort
|
function! ale#completion#HandleUserData(completed_item) abort
|
||||||
let l:source = get(get(b:, 'ale_completion_info', {}), 'source', '')
|
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
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -431,6 +431,12 @@ Execute(HandleUserData should call ale#code_action#HandleCodeAction):
|
|||||||
\})
|
\})
|
||||||
AssertEqual g:handle_code_action_called, 2
|
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):
|
Execute(ale#code_action#HandleCodeAction should not be called when when source is not ALE):
|
||||||
call MockHandleCodeAction()
|
call MockHandleCodeAction()
|
||||||
let b:ale_completion_info = {'source': 'syntastic'}
|
let b:ale_completion_info = {'source': 'syntastic'}
|
||||||
|
|||||||
Reference in New Issue
Block a user