The js syntax checker was 4 checkers stuffed into 1 file. Now it is
broken down so that each checker is in its own file inside
syntax_checkers/javascript/ while syntax_checkers/javascript.vim just
determines which file to source.
Change the names of the global js checker config variables so that
they all start with "syntastic_javascript_". This is purely for
namespacing.
Remove some unneeded logic around the config variables too. Not sure how
it got in there, but it was more confusing than helpful without offering
any benefits...
I installed the latest version of lessc and they have modified their
output slightly. Update the errorformat for this.
Also, they new output is colorized by default. So I have added an option
to specify args to the checker that currently defaults to "--no-color".
This means that if people want to use an older version of lessc, they
will need to reset this option to an empty string.
Only clear the cmd window when it is displaying a message that we
echoed. Previously we were echoing a blank line every time the cursor
moved - this was clearing messages generated from other sources than
syntastic.
In the javascript:jshint checker the error messages are being returned
with a newline prefixed to the front. I have tried to fix this in the
errorformat - but I cant see anything that would cause it.
Im not sure if this is a one-off thing, but strip out all new lines here
just in case.
Use SyntasticWarning and SyntasticError highlight groups when calling
matchadd(). This makes it trivial to clear all of our highlights without
having to store IDs.
Stole this code from kevinw's pull request (#46)
Many of the syntax checkers were setting the 'bufnr' key for each
error manually and one was setting 'text' if it didnt exist too.
Add the 'defaults' option to SyntasticMake to set default values in the
returned error list - it only sets values if they are empty.
Move 2 functions further up syntastic.vim so that all public functions
are at the bottom - purely to be tidy.
Stick some comments on functions - most functions now have at least a
one liner explaining them.
Also, rename a variable in SyntasticHighlightErrors (since I had to look
at the log to figure out what it was).
PHPCS has a wide variety of commandline flags, including
support for various syntaxes. These must be configurable,
otherwise phpcs generates a high number of spurious errors for
code written to any standard other than the PEAR standard.
* 'master' of https://github.com/millermedeiros/syntastic:
filter HTML5 warnings without using grep. see #53. see #81.
improve support for HTML5 attributes and refactor html.vim logic to allow adding new grep rules easily. see #53
PHPCS is a highly opinionated coding convention checker. It
reports conventional mistakes as syntax errors, and can be very
confusing (or just annoying). So I have added the option to
turn it off, while still getting the "real" syntax errors from
php's linter.
PHPCS has a wide variety of commandline flags, including
support for various syntaxes. These must be configurable,
otherwise phpcs generates a high number of spurious errors for
code written to any standard other than the PEAR standard.
Previously, if we edited a new bash script then we would have to wipeout
the buffer and recreate it to get syntastic to recognise it as a bash
script. This is because it parsed out a magic number and cached that -
and it trivially fails to find a magic number when you create a new
file.
So recheck for a magic number if it is currently empty.
Also, do a small refactor.
This was missing errors like this:
/tmp/foo.js:1:(-002) Error parsing file at token ")". Unable to check the rest of file.
The reason is because of the minus sign in front of the 002. It is using
%m to match that, which appears to only match positive numbers - so just
ignore the minus sign.
This is in response to #88 where errors like this were getting missed:
SyntaxError: In simpleMapComponent.js.coffee, Reserved word "function" on line 10
at SyntaxError (unknown source)
at Lexer.identifierError (/usr/lib/node_modules/coffee-script/lib/lexer.js:458:13)
at Lexer.identifierToken (/usr/lib/node_modules/coffee-script/lib/lexer.js:80:16)
at Lexer.tokenize (/usr/lib/node_modules/coffee-script/lib/lexer.js:31:19)
at Object.compile (/usr/lib/node_modules/coffee-script/lib/coffee-script.js:29:34)
at /usr/lib/node_modules/coffee-script/lib/command.js:149:33
at /usr/lib/node_modules/coffee-script/lib/command.js:115:26
at [object Object].<anonymous> (fs.js:107:5)
at [object Object].emit (events.js:61:17)
at afterRead (fs.js:878:12)
To fix this I have added another error matcher on the front of the
errorformat and have made a fix to the %-G matcher on the end (i.e. it
wasnt actually matching anything before).
The errorformat may need more updating.
Store error highlight IDs on a per window basis rather than per buffer.
This is needed as matchadd() adds highlights to the current window - not
buffer. This meant an error would occur when you open a file, create an
error that caused a highlight, then open the same file in a different
window - because it would call matchdelete() with an id that wasnt
defined for the current window.