mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Close #3333 - Add an ALECompletePost event
Add an `ALECompletePost` event along with everything needed to make it useful for its primary purpose: fixing code after inserting completions. * `ALEFix` can now be called with a bang (`!`) to suppress errors. * A new `ALELintStop` command lets you stop linting, and start it later.
This commit is contained in:
@@ -196,6 +196,10 @@ After:
|
||||
" Clear the messages between tests.
|
||||
echomsg ''
|
||||
|
||||
if !exists('g:ale_command_wrapper')
|
||||
let g:ale_command_wrapper = ''
|
||||
endif
|
||||
|
||||
Given testft (A file with three lines):
|
||||
a
|
||||
b
|
||||
@@ -206,6 +210,13 @@ Execute(ALEFix should complain when there are no functions to call):
|
||||
call ale#test#FlushJobs()
|
||||
AssertEqual 'No fixers have been defined. Try :ALEFixSuggest', GetLastMessage()
|
||||
|
||||
Execute(ALEFix should not complain when the command is run with a bang):
|
||||
echom 'none'
|
||||
|
||||
ALEFix!
|
||||
call ale#test#FlushJobs()
|
||||
AssertEqual 'none', GetLastMessage()
|
||||
|
||||
Execute(ALEFix should apply simple functions):
|
||||
let g:ale_fixers.testft = ['AddCarets']
|
||||
ALEFix
|
||||
@@ -715,6 +726,19 @@ Execute(ale#fix#InitBufferData() should set up the correct data):
|
||||
\ 'done': 0,
|
||||
\ 'lines_before': ['a', 'b', 'c'],
|
||||
\ 'should_save': 1,
|
||||
\ 'ignore_file_changed_errors': 0,
|
||||
\ },
|
||||
\}, g:ale_fix_buffer_data
|
||||
|
||||
call ale#fix#InitBufferData(bufnr(''), '!')
|
||||
|
||||
AssertEqual {
|
||||
\ bufnr(''): {
|
||||
\ 'temporary_directory_list': [],
|
||||
\ 'done': 0,
|
||||
\ 'lines_before': ['a', 'b', 'c'],
|
||||
\ 'should_save': 0,
|
||||
\ 'ignore_file_changed_errors': 1,
|
||||
\ },
|
||||
\}, g:ale_fix_buffer_data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user