From 626568d66d6c57a87cbbed830986e3087d1afca0 Mon Sep 17 00:00:00 2001 From: Vo Anh Duy Date: Sun, 13 Aug 2017 00:50:27 +0800 Subject: [PATCH] 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 --- ale_linters/haskell/ghc-mod.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ale_linters/haskell/ghc-mod.vim b/ale_linters/haskell/ghc-mod.vim index d3d2364..35f94c3 100644 --- a/ale_linters/haskell/ghc-mod.vim +++ b/ale_linters/haskell/ghc-mod.vim @@ -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', \})