Optimisation: merge handling of global and per-checker filters.
Feature: allow [] and '' values for quiet_messages filter elements.
Feature: allow overrides for quiet_messages filters.
Feature: buffer-local auto_jump and quiet_messages.
Safety: add magic specifiers to catch regexps.
Cleanup: minor restructuring for the forthcoming foreign checkers
feature.
String arguments to makeprgBuild() are used unchanged. Lists, both
inside checkers and in user variables, have their elements run through
syntastic#util#shescape() first. This solves an otherwise untractable
escaping problem.
There are situations when `make -s` can get stuck in a loop, even if
`make` itself would finish just fine. When this happens, Vim gets stuck
too, and has to be killed.
New options: g:syntastic_quiet_messages, and a per-checker version
of it named g:syntastic_<filetype>_<checker>_quiet_messages.
Option g:syntastic_quiet_warnings is now deprecated.
Option g:syntastic_ignore_files now refers only to files that shouldn't
be checked.
New variables: g:syntastic_debug_file, the name of a file where to write
debugging messages, in addition to adding them to the message history.
The old g:syntastic_debug is now a sum of flags:
* 1 - trace checker calls
* 2 - dump loclists
* 4 - trace notifiers
* 8 - trace autocommands
* 16 - dump syntastic variables (not implemented yet)
(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).
This is not completely safe: if a loclist is created by something
other than syntastic before the error window is displayed, syntastic
will obliterate it. There is currently no way to tell if a
loclist was created by syntastic or not. Undocumented variable
g:syntastic_reuse_loc_lists can be used to disable reuse of loclists.
Also handle the case when user disables notifiers after the first run.
This doesn't work for signs though, since it causes an ugly flicker in
the common case.
This is a first step towards making :lolder and :lnewer work with
Syntastic. It still has a long way to go: a new loclist is now craeted
at each run of SyntasticMake(), but the notification machinery can only
use the last one. Ideally a single loclist would be created per window
and then reused.
If the first error in the location list refers to a file that isn't
loaded, entering the quickfix window would close it.
If `hidden` is set, `:quit`-ing the main file would not close the
quickfix window.
Move the autoloc list toggling out into its own notifier class.
Move the function that echos the error on the current line out into its
own notifier.
A few other changes were required in the process:
* move s:WideMsg() out into syntastic#util autoload lib so it is
available from the cursor notifier.
* move s:ShowLocList() into the LocList class so it is available for
the autoloclist notifier
* move s:HideLocList() into Loclist as a class method mainly to keep the
two show/hide methods together
* move the s:old_line var into the Cursor notifier where it is needed
Creates a notifier class.
Changes the existing signer class to fit the new notifier.
Moves balloons and highlighting to their own classes.
Caches and speeds up EchoCurrentError().
Adds all relevant messages to balloons rather than using the first one.
Fixes yet another (minor) bug related to g:syntastic_quiet_warnings.
The variable force_highlight_callback is gone.
Highlight functions are now consistently named
SyntaxCheckers_<filetype>_<checker>_GetHighlightRegex(), and they
take precedence over highlighting based on column.
If a filetype has default checker settings, then only allow those
checkers to be used by default. The user must manually specify other
checkers to use if they dont want the default.
In future the `s:defaultCheckers` hash should be more complex (or
possibly an object) that allows us to specify "only" vs "preferred".
This change was made in response to the html filetype using the w3
checker when tidy is not installed.
Add CurrentFiletypes function as this logic was getting used in a couple
of places and needed a home/name - mostly because of the bizarre
substitute call that needs explanation.
Move the code to get a syntax checker by name into SyntasticRegistry
Add SyntasticLoclist class to wrap up loclists, and move loclist query
methods from syntatic.vim to the new class.
Make SyntasticChecker#getLocList() return a SyntasticLoclist.
* add a system for setting default checkers
* return the first check we find, unless told to chain checkers together
by default settings, or user settings
Add 2 classes: SyntasticChecker and SyntasticRegistry.
SyntasticChecker represents a checker. It holds funcrefs to the checker
func, the highlight regex func and a new `isAvailable()` func (that
essentially just checks if the checker exe is installed)
SyntasticRegistry is responsible for:
* loading checkers
* storing checkers
* fetching the checkers to use according to availability and the users
settings
Motivation/benefits:
* in the current system only one checker can be loaded per filetype
* syntax checkers cant be "chained" together
* the system is hard to add features to since fundamental concepts like
syntax checkers and location lists arent represented explicitly
Things left to do:
* add a call to g:SyntasticRegistry.CreateAndRegisterChecker() to all
checkers
* add an `isAvailable` function to all checkers
* move all checkers into `syntax_checkers/filetype/checkername.vim` -
g:SyntasticRegistry assumes this layout, and its a good idea anyway
for consistency and it makes it easier for users to add their own
checkers
Things to do after all of the above:
* add a LocationList class and move all the filtering functions onto it
* possibly add an Error class that wraps up each item in a loc list
Random notes:
* with the new system you can select the checkers to use with e.g.
`let g:syntastic_python_checkers=['flake8', 'pylint']`
This will try flake8 first, and if no errors are detected it will move
onto pylint.