VIM version
NVIM v0.2.2
Release
Operating System: Mac OS 10.13.3
Current Filetype: haskell
Available Linters: ['ghc-mod', 'stack-ghc-mod', 'ghc', 'hdevtools', 'hlint', 'stack-build', 'stack-ghc']
Enabled Linters: ['hdevtools', 'hlint', 'stack-build', 'stack-ghc']
Linter Variables:
let g:ale_haskell_hdevtools_executable = 'hdevtools'
let g:ale_haskell_hdevtools_options = '-g -Wall'
Global Variables:
let g:ale_cache_executable_check_failures = 0
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = 50
let g:ale_echo_cursor = 1
let g:ale_echo_msg
Incorrectly reports "cannot find module" when I include ghc in the list of linters.
Steps for repeating the bug:
import Numeric.Sumghc as a linter (or specify a list of linters that excludes ghc)Note: The title says "might". I believe I'm getting this issue because I only use stack. I don't have the modules installed in a way that only uses cabal. So, if you have both approaches working, I don't expect a person would experience this issue. However, given how stack is becoming the preferred manager, and how ghc-mod also now works with stack, I expect this might become an issue for more and more users.
I am having the same issue while using neovim under a nix-shell that contains only ghc and cabal. I can get stack to work, however I'm no longer using stack as part of my dev system.
Sounds like you just need to turn ghc off on your machine, then. I don't think there's anything that can be done about this.
For for anyone that sees this and want's to only disable GHC linting in stack projects:
~/.config/nvim/init.vim (or ~/.vimrc if not using neovim)
function CheckIfFileExists(filename)
if filereadable(a:filename)
return 1
endif
return 0
endfunction
...
" Disable GHC linter if in a Haskell Stack project
if (CheckIfFileExists("./stack.yaml") == 1)
let g:ale_linters = {
\ 'haskell': ['stack-build'], " you can include any other linters in this list too
\}
endif
Most helpful comment
For for anyone that sees this and want's to only disable GHC linting in stack projects:
~/.config/nvim/init.vim (or ~/.vimrc if not using neovim)