This gist demonstrates a ghcide setup with nix.
No project file (.cabal
, package.yaml
, stack.yaml
, etc.) is necessary.
Before attempting editor integration, test ghcide in the terminal by running this command:
nix-shell --pure --run ghcide
This will search for Haskell source files and print any errors encountered, which can help you determine whether e.g. ghcide is seeing all of your project dependencies correctly.
For Visual Studio Code integration, install the ghcide
extension and use the following settings:
- Executable path:
./ghcide.sh
- Arguments: (empty)
what is the purpose of
hie.yml
? I was able to get this working without it, but wondering if I missed something?also the LOCAL_ARCHIVE was consistently causing this to fail for me so I removed it. Is there a reason that it's necessary? The error was:
error: cannot coerce null to a string, at /Users/willisplummer/code/nix-haskell-starter/shell.nix:29:19