From 02c0d5bcb9f7d4191a5e069aa0b8cd4065d6c039 Mon Sep 17 00:00:00 2001 From: Anthony Poon Date: Fri, 26 Oct 2018 01:30:49 +1100 Subject: Only run stack if a stack.yaml config is found (#1752) * Only run stack if a stack.yaml config is found It is necessary to check for a stack.yaml file to distinguish between cabal-only projects or stack projects (which are also cabal projects since stack is built on top of cabal). * Test that stack is called if stack.yaml exists --- autoload/ale/handlers/haskell.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'autoload') diff --git a/autoload/ale/handlers/haskell.vim b/autoload/ale/handlers/haskell.vim index 9223b650..9e495b36 100644 --- a/autoload/ale/handlers/haskell.vim +++ b/autoload/ale/handlers/haskell.vim @@ -1,5 +1,15 @@ " Author: w0rp " Description: Error handling for the format GHC outputs. +" +function! ale#handlers#haskell#GetStackExecutable(bufnr) abort + if ale#path#FindNearestFile(a:bufnr, 'stack.yaml') isnot# '' + return 'stack' + endif + + " if there is no stack.yaml file, we don't use stack even if it exists, + " so we return '', because executable('') apparently always fails + return '' +endfunction " Remember the directory used for temporary files for Vim. let s:temp_dir = fnamemodify(ale#util#Tempname(), ':h') -- cgit v1.2.3