haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.39k stars 211 forks source link

ghc-mod vs stack exec ghc-mod #527

Closed rainwolf closed 5 years ago

rainwolf commented 6 years ago

When editing a standalone .hs file and importing Parsec, hie's ghcmod complains about a module not being found, and I can reproduce that error with the ghc-mod binary.

But, when invoking ghc-mod via stac exec ghc-mod, the error goes away, and I merely get a warning about a redundant import, as I expect. Is there any way to achieve this with hie?

nponeccop commented 6 years ago

Hie uses ghc-mod as a statically linked library. Generally it is a special fork of ghc-mod:

https://github.com/haskell/haskell-ide-engine/blob/93bf1e2c3aaf3dcfde43fbffc42828860a6ef3e2/stack.yaml#L11-L15

So it doesn't/can't use any other ghc-mod.

So this error you get may be due to 2 reasons: