Haskero shows errors when changing Cabal file
-
Bug description :
-
Observed behaviour : When the project dependencies change, or extensions are added to the default-extensions in the cabal file, Haskero will show errors when using the new dependencies or features. This probably has to do with Intero needing to be restarted or similar.
-
Expected behaviour : New features should be usable without restarting VS code.
-
OS: windows
-
Plugin (ghc, stack, intero and haskero) version and VSCode version used :
stack Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 ghc The Glorious Glasgow Haskell Compilation System, version 8.2.2 intero Intero 0.1.31 haskero latest VS code 1.23.0 7c7da59c2333a1306c41e6e7b68d7f0caa7b3d45 x64
- Steps to reproduce:
-
stack new project simple
-
open vs code, edit the Main.hs file
-
open cabal file, add some extension or dependency (i.e. parsec)
-
use the extension or dependency (i.e. import Text.Parsec)
This shows an error, which you'd kind of expect since stack build
has yet to be executed. Imagine you do:
-
stack build
-
go to vs code, trigger a check.
This also shows an error, but it shouldn't, as you have all dependencies installed.
- If the issue is hard to repeat on an empty haskell project, a link to a repository containing a sample repeating the issue
One way this should be easy to fix is to restart Intero whenever the cabal file is changed. This would probably fail anyways because of the dependency issue above, but there may be some other way to fix it.