Back in the past I used to have to write a hie.yaml
to get HLS (through lsp
in emacs
) to work correctly. It always just contained
cradle:
cabal:
More recently it seemed that I didn’t have to do that. Somehow it just worked out itself that the cradle should be cabal. I don’t think I’ve written a hie.yaml
file by hand in at least a year. However, even more recently, HLS stopped being able to see modules from external packages (i.e. from non-boot packages). The first hit on Kagi is an HLS Github issues that explains that you have to write a hie.yaml
file, but it’s from 2020.
What is the current status of this? Should I expect HLS to set up a cabal cradle for me by default? Last time I looked into this, cradle discovery had some heuristics about detecting .cabal
or stack.yaml
files to work out which cradle to choose automatically, but it was often flaky. Have I got the configuration wrong somewhere else?
The user experience around this is rather sad. There’s no indication at all what’s wrong. HLS just says it can’t find the modules in question, even though cabal build
works without problems. I wouldn’t expect a new user to have the patience to resolve this issue. I’d expect them to just stop using HLS (or even stop using Haskell).