Commit Graph

173 Commits

Author SHA1 Message Date
Martin Grenfell
368505eb60 coffee: split up coffee and coffeelint 2013-02-06 13:59:27 +00:00
Martin Grenfell
9f08ff9cf6 html: only try to run tidy by default - not w3c
The w3c checker goes out to the internet to get its results so disable
it by default.
2013-02-06 13:47:41 +00:00
LCD 47
17641c0a49 Minor omission in commit 8f4695c. 2013-02-03 20:36:55 +02:00
Martin Grenfell
a66c19f731 move the MakeprgBuilder class in with the rest of the classes 2013-02-01 17:06:32 +00:00
Martin Grenfell
59cbf1c69e dont call setloclist() until the user calls :Errors 2013-02-01 16:52:11 +00:00
Martin Grenfell
0b0dbc56e6 dont allow checkers with duplicate names for the same filetype 2013-02-01 15:01:31 +00:00
Martin Grenfell
c97951b601 make a few refactors
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
2013-02-01 14:38:53 +00:00
Martin Grenfell
0b3e074f8c Merge remote-tracking branch 'dbarnett/cmd_arg' 2013-02-01 14:18:31 +00:00
Martin Grenfell
8f4695c6de add a class to encapsulate loclists
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.
2013-02-01 14:17:55 +00:00
Martin Grenfell
f67d4881ca remove some old (now unused) code from the main plugin 2013-02-01 09:57:25 +00:00
David Barnett
40de98c2fc Add completion for checker name in :SyntasticCheck command 2013-01-31 23:36:41 -08:00
David Barnett
557321faae Support checker name as argument to :SyntasticCheck 2013-01-31 23:20:24 -08:00
Martin Grenfell
653611ccac split up php checker into php, phpmd and phpcs 2013-01-31 17:31:40 +00:00
Martin Grenfell
c166029fd8 add a couple more default checker settings 2013-01-31 10:52:15 +00:00
Martin Grenfell
a4a7b5697c update how checkers are chosen
* 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
2013-01-27 23:59:47 +00:00
Martin Grenfell
e0b8e87c93 refactor all the syntax checkers to use the new API and dir layout 2013-01-27 20:08:30 +00:00
Martin Grenfell
58ba8d3161 refactor how we represent and store checkers using python as a demo
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.
2013-01-24 00:19:13 +00:00
Martin Grenfell
d48f43c222 wrap screen redrawing in a function to try and avoid screen flicker
Some versions of gvim flicker when `redraw!` is used. Use `redraw` for
them and use `redraw!` for terminal vim.

Fixes #449
2013-01-16 09:42:22 +00:00
Martin Grenfell
fc4ec2533c Merge branch 'load_any_checker' 2012-12-04 09:33:34 +00:00
Martin Grenfell
42480a01a1 modify SyntasticLoadChecker to load any checkers present
Previously we were only loading "official" checkers that had been added
to syntastic. Now we load any checker that is in the right directory.

This allows anyone to add custom checkers to any filetype that uses
`SyntasticLoadChecker()`
2012-12-03 21:22:44 +00:00
Martin Grenfell
7fe3ac44c2 allow custom checkers by just defining a checking function
Problem: users want to define their own checking function and not use
the syntastic defaults

Solution: dont load the syntastic default if a checking function
already exists. This way users can just define their own function and
override syntastic.

e.g. the user wants to have their own ruby checker, so in their vimrc
they just add:

    function! SyntaxCheckers_ruby_GetLocList()
        return SyntasticMake({"some custom stuff"})
    endfunction
2012-12-03 10:59:11 +00:00
David Barnett
b209693a2a Only set g:loaded_FT_syntax_checker if unset 2012-11-27 07:43:42 -08:00
David Barnett
dcac33ecc0 Set g:loaded_FOO_syntax_checker in syntastic.vim, not every ft file. 2012-11-26 21:44:43 -08:00
Martin Grenfell
36db8f4b16 fix a bug with highlighting and getmatches
Highlighting requires vim >= 7.1 with patch 40. It should be disabled
otherwise.

Fix a bug with the version check.

Closes #250.
2012-11-17 20:15:45 +00:00
Charles Lehner
3199ca3235 Explain why tabs are converted to spaces in error messages. 2012-10-25 20:01:31 -04:00
Charles Lehner
57e962865f Prevent tabs in error messages from causing "press enter" prompt.
Convert the tabs to spaces so that they are counted towards the window width
and the status message does not wrap.
2012-10-25 17:20:07 -04:00
Martin Grenfell
33427121ec fix a bug introduced in 60a3588d30
Two different calculations were incorrectly combined in
s:OSSupportsShellpipeHack().

Introduce s:IsRedrawRequiredAfterMake() to hold the other calculation.

Closes #388
2012-10-23 23:05:00 +01:00
Richard Brown
6382dc2124 Put getmatches check in a more sensible place 2012-10-01 15:10:53 +01:00
Richard Brown
ca1d129b3f s/HightlightErrors/HighlightErrors/g 2012-09-27 13:45:14 +01:00
Richard Brown
4bb4ec6550 Highlighting requires vim-7.1.040
Fixes Issue #250
2012-09-27 13:44:45 +01:00
Martin Grenfell
9849a6b8ac move s:uname() in with the rest of the functions - close to its usage 2012-09-24 18:53:15 +01:00
Martin Grenfell
9ccef501e9 Merge remote-tracking branch 'cehoffman/master'
Conflicts:
	plugin/syntastic.vim
2012-09-24 18:52:18 +01:00
Richard Brown
87f10e54d4 Make IsVersionAtLeast global 2012-09-22 19:51:12 +01:00
Martin Grenfell
127422c11e move SyntasticCheckable() down with the other public functions 2012-09-18 00:41:36 +01:00
Martin Grenfell
171776140b Merge remote-tracking branch 'rbrown/sh2'
Conflicts:
	syntax_checkers/sh.vim
2012-09-18 00:20:15 +01:00
Martin Grenfell
70f8354420 Merge pull request #318 from dstanek/master
Fixes issue #311
2012-09-07 02:35:15 -07:00
Richard Brown
0140f4baca Add syntax checker for ft=zsh
The current sh.vim checks for ft=sh and #!/bin/zsh  This add a checker
specifically for ft=zsh and changes sh.vim to call the same code.
2012-09-06 09:53:34 +01:00
Jamie Wong
98437c8752 Always update the location list, even if empty 2012-08-25 01:41:05 -04:00
David Stanek
2bad8761fa Fixes #311: errors not showing up in statusline
s:Errors() function loops through the location list lookin for errors
and caches the result. The function is called indirectly by
SynasticStatuslineFlag before the location list has content. This patch
ensures s:Errors only gets called if location list has content.
2012-08-10 03:23:46 -04:00
Martin Grenfell
1fb8366456 Merge pull request #244 from mootoh/master
Javascript syntax check with Google Closure Compiler
2012-07-28 09:43:42 -07:00
Martin Grenfell
cdd36c6479 populate the location list when :Errors is called
The location list must be set when calling :Errors since our cached
error list is associated with the buffer, but the vim loclist is
associated with the window.

So if the user closes a window, the vim loclist will get destroyed, but
our error list will still exist.

Closes #263
2012-07-24 12:25:16 +01:00
Arnout Kazemier
5ec845ea0d Added configuration option for the symbols that are used in the signs.
This allows users to configure their own indicators symbols
2012-07-17 16:05:51 +02:00
Martin Grenfell
60a3588d30 refactor the checks for the shell/shellpipe hack compatability
move the check into its own function to DRY up the code and add an
intention revealing name to the if statements
2012-07-01 22:48:54 +01:00
Aaron Bieber
e315263ba6 Add fix for OpenBSD 2012-05-25 12:53:21 -06:00
Chris Hoffman
98b7e0e01b Delay an expensive startup cost until needed 2012-05-08 09:58:06 -05:00
Hong Xu
30d7462249 Remove some unnecessary win64 checks.
has('win32') is always true on Win64.
2012-05-08 20:31:20 +08:00
Motohiro Takayama
b94510fea3 Do not check if the syntax_checker exists and is executable.
Syntax checker name should be the filename of the syntax_checkers/*.vim.
It can be any filename, and can be the name which does not exist in the PATH.
2012-05-07 12:23:51 -07:00
Martin Grenfell
5c7f2b800d Merge pull request #227 from mschulkind/master
Stop clobbering global variables
2012-04-20 07:15:30 -07:00
Matthew Schulkind
4611645c18 Stop clobbering global options. 2012-04-20 10:11:07 -04:00
Florent Bruneau
999d3c1bb3 Only keep "valid" entries in the error count.
The location list returned by getloclist() may contain entries that are
not errorformat matches. By "definition", (see :help getqflist), matched
lines have the attribute "valid": 1 set, so only keep those lines in
error/warning list to avoid erroneous counts and strange behaviors.

Signed-off-by: Florent Bruneau <florent.bruneau@intersec.com>
2012-03-28 19:48:54 +02:00