haskell-ide-engine
haskell-ide-engine copied to clipboard
Hoogle warning when Haddock docs present
As I understand it (correct me if I'm wrong / over-simplifying), Hie uses Hoogle when Haddock docs are not present. My project is configured with --enable-documentation and thus, as far as I'm aware, I'm not missing out on any features that Hoogle would provide.
However, on startup, this extension will always issue the 'No hoogle database found...' warning if it can't find a Hoogle database. This is rather confusing, as it implies the user is missing out on something.
Hie uses Hoogle for Documentation if Haddock are not present.
However, there are features such as the import functionality of HsImport that depend only on Hoogle. So, yeah, you are missing out on a quickaction to import symbols from a library, if they arent already in scope.
Example:
main = hPutStrLn stderr "Error"
Can be turned with two code actions into:
import System.IO (hPutStrLn, stderr)
main = hPutStrLn stderr "Error"
Oh neat, I didn't realise that had been implemented.
I guess the warning (or the actual documentation for Hie) could be improved by stating why a Hoogle database is useful, even in the presence of Haddocks.
FWIW, I struggled a bit to find how to get HIE to pick up my Hoogle database, but it turned out that hoogle generate -l from the project root is all that was needed.
There are some caveats though: it can only be used to import symbols from external libraries, nothing from the local project and import of types is broken, atm.
The issue for that is https://github.com/haskell/haskell-ide-engine/issues/1366.
When you install hie from source, the target data is recommended, which does this for you! https://github.com/haskell/haskell-ide-engine#building
Ah fair enough. Now that running cabal install (with new-style cabal) just works, I've been running that. I'll make sure to use the proper script next time I update.