Commit Graph

283 Commits

Author SHA1 Message Date
LCD 47
11380c2d51 Minor cleanup.
Warning signs should not overwrite error ones.
Use buffers instead of file names when placing signs.
Other minor changes.
2013-04-10 13:40:03 +03:00
LCD 47
31b654301b Fix for #597.
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.
2013-04-09 18:20:14 +03:00
Martin Grenfell
2b6f6a5724 move s:Loclist() into SyntasticLoclist as a class method 2013-04-09 09:52:02 +01:00
LCD 47
92a25ed1a2 More cleaning up.
Renames notification classes.
Fixes a stupid bug related to the cursor notifier.
2013-04-09 01:10:17 +03:00
LCD 47
90dce6d3e7 Cleanup.
Makes cursor a standard notifier.
Adds a method enabled() to the notifiers.
Adds an optional method reset() to the notifiers.
2013-04-09 00:24:54 +03:00
Martin Grenfell
9a7db4a50b move a couple of options out into relevant notifiers 2013-04-07 23:30:24 +01:00
Martin Grenfell
dc3d80a204 more refactors to the Notifier classes
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
2013-04-07 23:06:02 +01:00
LCD 47
0deeefd08e Notifiers refactor.
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.
2013-04-07 22:10:26 +03:00
LCD 47
01232979aa Fix signs initialization.
Signs should be initialized even if they aren't enabled at startup.
2013-04-06 23:10:27 +03:00
LCD 47
e473038e66 Fixes handling of g:syntastic_quiet_warnings.
Fixes signs (leftover from commit 878bcea).
2013-04-06 21:19:30 +03:00
LCD 47
878bceaac7 Fixes handling of g:syntastic_quiet_warnings. 2013-04-03 21:53:56 +03:00
Yosuke ONOUE
01ce9e3daf Fixed error on SyntasticToggleMode. 2013-03-25 14:16:58 +09:00
Martin Grenfell
d35e273d33 move the modemap code out into its own class 2013-03-22 22:50:47 +00:00
Martin Grenfell
925ba796c9 move the sign options into the sign class file 2013-03-22 18:08:27 +00:00
Martin Grenfell
84aae9b87f fix some guards 2013-03-22 18:07:50 +00:00
Martin Grenfell
6193c99f69 extract the sign code out into its own class 2013-03-21 17:46:13 +00:00
Martin Grenfell
fd90fdf9f4 SyntasticChecker: extract out the highlight regex population code 2013-03-18 10:01:56 +00:00
LCD 47
0906a5c5d1 Cleanup: a simpler and more efficient approach. 2013-03-18 10:01:56 +00:00
LCD 47
ff3c05a413 Fix syntax highlighting.
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.
2013-03-08 14:45:57 +00:00
David Barnett
a4a2867e8e Add support for buffer-local b:syntastic_checkers var. 2013-02-24 21:35:57 -08:00
Martin Grenfell
8cc63c729a be more strict with default checker settings
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.
2013-02-21 16:50:39 +00:00
Martin Grenfell
924cf68c2e add a function to get the active checker names for a filetype 2013-02-09 17:49:01 +00:00
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
Martin Grenfell
a66c19f731 move the MakeprgBuilder class in with the rest of the classes 2013-02-01 17:06:32 +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
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
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