IDE support when working on GHC
Here are some notes for how I configure Neovim, haskell-language-server
, and clangd
for an IDE-like experience when working on GHC:
start using this an up-to-date ghc.nix
start a
ghc.nix
shell:nix-shell ../ghc.nix --arg withIde true
configure
nvim-lspconfig
’s HLS support to correctly identify the root directory of a GHC source tree:configure
nvim-lspconfig
useclangd
:create a
compile_flags.txt
forclangd
(ideally this would be upstreamed as a.clangd
file but this mechanism doesn’t appear to work):-xc -Iincludes -Irts -I.hie-bios/stage0/lib
Run
haskell-language-server-wrapper compiler/GHC.hs
to ensure that things work (and generate various things in.hie-bios
)Enjoy