Allow function aliases to be registered for fixing problems, and add some more argument checking for fixing problems

This commit is contained in:
w0rp
2017-05-18 23:50:06 +01:00
parent ea1627f5ce
commit 1f4d1800e0
3 changed files with 106 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ After:
delfunction DoNothing
delfunction CatLine
delfunction ReplaceWithTempFile
call ale#fix#registry#ResetToDefaults()
Given testft (A file with three lines):
a
@@ -126,3 +127,18 @@ Expect(The first function should be used):
^a
^b
^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):
call ale#fix#registry#Add('add_carets', 'AddCarets', [], 'Add some carets')
let g:ale_fixers.testft = ['add_carets']
ALEFix
Expect(The registry function should be used):
^a
^b
^c