These are instructions about how to use the experimental support for haskell-ide-engine on GHC.
Note that this will only work whilst editing the main compiler currently, it won't work with subcomponents or hadrian. That's future work.
- Build this branch using cabal new-build - https://github.com/mpickering/haskell-ide-engine/tree/hie-bios
- Install the "Haskell Language Server" extension in vscode
- Set the "Hie Executable Path" to the executable you just built
- Disable "Diagnostics on Change" - It's too slow to work on GHC.
- Create a
hie.yaml
file in the root directory with the following contents:
cradle: {bios: {program: "hie-bios"}}
- Create an executable file in the root directory called
hie-bios
#! /usr/bin/env bash
echo $(TERM=dumb CABFLAGS=-v0 ./hadrian/build.cabal.sh tool-args -q --build-root=_ghci --flavour=ghc-in-ghci) -ighc ghc/Main.hs
-
Execute the
hie-bios
file in your terminal - it should take 1-2 minutes before printing out some options. This is a testing step to see everything is set up properly. -
Open the GHC folder in vscode and open a file such as
compiler/utils/FV.hs
. After a short period editor features should work. Try hovering, going to definition, finding references and so on.