Error sorting can't be done as a postprocess function called from
SyntasticMake(), since the final values of some relevant fields (f.i.
type) might not be known yet at that point. Solution: move sorting to
getLocListRaw(), after per-checker quiet_messages. New checker methods
getWantSort() / setWantSort() are needed.
Second problem: some checkers return screen columns mixed with byte
indices. Solution: compute screen columns as needed. Sadly, everything
about working with screen columns is fragile.
(1) Checkers now have an _exec attribute, and an accessor getExec().
(2) CreateAndRegisterChecker() initializes _exec from an optional argument
'exec'. If this argument is missing, 'name' is used instead.
(3) Functions SyntaxCheckers_*_IsAvailable() are now dictionary functions.
(4) Functions SyntaxCheckers_*_IsAvailable() are now optional. When
they are missing, they are assumed to return executable(expand(self.getExec())).
(5) Argument 'exe' of function syntastic#makeprg#build() is now optional.
If this argument is missing, expand(self.getExec()) is used to set checker
executables.
Make SyntaxCheckers_*_GetLocList() dictionary functions.
Pass a reference to the current checker to syntastic#makeprg#build().
Add an optional 'redirect' argument to CreateAndRegisterChecker().
Change the sh checker to use the new dictionary functions.
Add a new registry method getLocListRaw() (needed for the sh checker).
Scenario:
- a C file is recognized as having filetype cpp
- run :SyntasticInfo
- run :setf c
- run :SyntasticInfo again
The only checker recognized will be oclint. The reason is, oclint is
registered as a c checker when called from cpp initialization, and that
prevents registering other c checkers when calling ':setf c'.
Solution: always initialize all checkers for a filetype.
This patch adds an option 'postprocess' to SyntasticMake(). The value
of this option is a list of names. Each name is translated to a
function syntastic#postprocess#name(). These functions are applied in
order to the list of errors just before SyntasticMake() returns. They
take a single parameter, the list of errors, and are supposed to
returned the processed list.