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)
@willisplummer I don't remember the purpose of
hie.yml
and I no longer use it, so I suspect you can safely ignore it!I typically set
LC_ALL
andLOCALE_ARCHIVE
in any shell hook because when nix-shell strips environment variables, it unsets the locale and causes encoding issues, and setting these tends to get everything reliably back into UTF-8. I'm not sure why it wouldn't be working for you.