Permalink
Browse files

haskell: configurable ghc-mod arguments, default to support for HSP

  • Loading branch information...
dag committed Mar 27, 2012
1 parent b4e85a8 commit 8d6fe0d6c2a14eb136e78771816ad0c8fa700d67
Showing with 7 additions and 2 deletions.
  1. +7 −2 syntax_checkers/haskell.vim
@@ -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,'.

4 comments on commit 8d6fe0d

@MichaelXavier

This comment has been minimized.

Show comment Hide comment
@MichaelXavier

MichaelXavier May 4, 2012

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.

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.

@dag

This comment has been minimized.

Show comment Hide comment
@dag

dag May 4, 2012

Contributor

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.

Contributor

dag replied May 4, 2012

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.

@wuzzeb

This comment has been minimized.

Show comment Hide comment
@wuzzeb

wuzzeb May 4, 2012

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

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

@dag

This comment has been minimized.

Show comment Hide comment
@dag

dag May 4, 2012

Contributor

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

Contributor

dag replied May 4, 2012

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

Please sign in to comment.