626568d66d
Right now ghc-mod linter check temp file instead of current buffer, which cause the problem that it can't detect cabal file and raise missing package error. To fix that we need to run ghc-mod check with actual path of the current file and with ghc-mod option `--map-file` to redirect temp file source code to actual one
16 lines
494 B
VimL
16 lines
494 B
VimL
" Author: wizzup <wizzup@gmail.com>
|
|
" Description: ghc-mod for Haskell files
|
|
|
|
call ale#linter#Define('haskell', {
|
|
\ 'name': 'ghc-mod',
|
|
\ 'executable': 'ghc-mod',
|
|
\ 'command': 'ghc-mod --map-file %s=%t check %s',
|
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
|
\})
|
|
|
|
call ale#linter#Define('haskell', {
|
|
\ 'name': 'stack-ghc-mod',
|
|
\ 'executable': 'stack',
|
|
\ 'command': 'stack exec ghc-mod --map-file %s=%t check %s',
|
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
|
\})
|