Remove the code for checking if functions exist. It breaks autoload functions

This commit is contained in:
w0rp 2017-05-19 09:49:00 +01:00
parent 1f4d1800e0
commit 4214832ae2
2 changed files with 5 additions and 20 deletions

View File

@ -241,29 +241,19 @@ function! s:GetCallbacks() abort
return [] return []
endif endif
let l:problem_list = []
let l:corrected_list = [] let l:corrected_list = []
for l:item in l:callback_list for l:item in l:callback_list
if type(l:item) == type('') if type(l:item) == type('')
if exists('*' . l:item)
call add(l:corrected_list, function(l:item))
else
let l:func = ale#fix#registry#GetFunc(l:item) let l:func = ale#fix#registry#GetFunc(l:item)
if !empty(l:func) && exists('*' . l:func) if !empty(l:func)
call add(l:corrected_list, function(l:func)) let l:item = l:func
else
call add(l:problem_list, l:item)
endif endif
endif endif
endif
endfor
if !empty(l:problem_list) call add(l:corrected_list, function(l:item))
echoerr 'Invalid fixers used: ' . string(l:problem_list) endfor
return []
endif
return l:corrected_list return l:corrected_list
endfunction endfunction

View File

@ -128,11 +128,6 @@ Expect(The first function should be used):
^b ^b
^c ^c
Execute(ALEFix should complain for missing functions):
let g:ale_fixers.testft = ['XXX', 'YYY']
AssertThrows ALEFix
AssertEqual 'Vim(echoerr):Invalid fixers used: [''XXX'', ''YYY'']', g:vader_exception
Execute(ALEFix should use functions from the registry): Execute(ALEFix should use functions from the registry):
call ale#fix#registry#Add('add_carets', 'AddCarets', [], 'Add some carets') call ale#fix#registry#Add('add_carets', 'AddCarets', [], 'Add some carets')
let g:ale_fixers.testft = ['add_carets'] let g:ale_fixers.testft = ['add_carets']