Make ghc-mod be awared of cabal file
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
This commit is contained in:
parent
e6b6146731
commit
626568d66d
@ -4,13 +4,13 @@
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'ghc-mod',
|
||||
\ 'executable': 'ghc-mod',
|
||||
\ 'command': 'ghc-mod check %t',
|
||||
\ '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 check %t',
|
||||
\ 'command': 'stack exec ghc-mod --map-file %s=%t check %s',
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
Loading…
Reference in New Issue
Block a user