Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make Haskell checker configurable #218

Merged
merged 1 commit into from

4 participants

Dag Odenhall Martin Grenfell John Lenz Michael Xavier
Dag Odenhall

No description provided.

Martin Grenfell
Owner

Hey, im keen to pull this, but just wanted to check if the default options you have selected will change the current behaviour of the syntax checker. Would be ideal if people pull this code and dont notice any change :)

Dag Odenhall

They'd notice that it's less broken. Without these defaults, the two commands it runs will produce conflicting reports for some files: the latter will claim a syntax error, while the former continues to function as if there is no syntax error. These defaults make the two commands behave more like each other.

Martin Grenfell scrooloose merged commit d868417 into from
Martin Grenfell
Owner

OK, good enough for me :)

Michael Xavier

Hey dag, I was wondering if you knew how to get multi-line output for this syntax checker. Currently the syntax checker just shows the first line to me. Given how many lines are in a common GHC type error, this limits the usefulness of the syntax checker.

Take a look at the cabal compiler description in my vim2hs project: https://github.com/dag/vim2hs/blob/master/compiler/cabal.vim

I haven't looked into if this is compatible with ghc-mod.

That cabal compiler script is helpful. Any intention of submitting it upstream to be included in vim by default?

Maybe once vim2hs is more stable/proven I'll look at decoupling parts of it for upstream...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 syntax_checkers/haskell.vim
9 syntax_checkers/haskell.vim
View
@@ -19,11 +19,16 @@ if !executable("ghc-mod")
finish
endif
+if !exists('g:syntastic_haskell_checker_args')
+ let g:syntastic_haskell_checker_args = '--hlintOpt="--language=XmlSyntax"'
+endif
+
function! SyntaxCheckers_haskell_GetLocList()
+ let ghcmod = 'ghc-mod ' . g:syntastic_haskell_checker_args
let makeprg =
\ "{ ".
- \ "ghc-mod check ". shellescape(expand('%')) . "; " .
- \ "ghc-mod lint " . shellescape(expand('%')) . ";" .
+ \ ghcmod . " check ". shellescape(expand('%')) . "; " .
+ \ ghcmod . " lint " . shellescape(expand('%')) . ";" .
\ " }"
let errorformat = '%-G\\s%#,%f:%l:%c:%trror: %m,%f:%l:%c:%tarning: %m,'.
\ '%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,%f:%l:%c:%m,'.
Something went wrong with that request. Please try again.