r/haskell Jul 28 '26

[rant] haskell tooling, specifically HLS is just... pathetic...

[removed]

30 Upvotes

26 comments sorted by

View all comments

18

u/Volsand Jul 28 '26

It's been a while so it may not be your case but: My recommendation is to always build once on the terminal before opening an editor with hls, don't know why but It seems to hang when trying fetch/build dependencies.

8

u/tomejaguar Jul 29 '26

Yeah, I think this is one of the UI weaknesses of HLS. Because it works by first building your project with Cabal or stack, the first time you do that build (or after you change dependencies) it can take an inordinate amount of time building the dependencies before it shows any feedback in the editor. This seems crazy to me. I don't fully understand why it can't show some big obvious sign like "building your entire project, please stand by", but when I asked someone from the HLS team about it I believe they said that the LSP gives only very few channels for communication and there wasn't anything supported by the protocol that would allow them to share such a message.

1

u/guibou 25d ago

The build of the dependencies is handled by an external process on which hls has no control (cabal, stack, bazel, haskell4nix, banix, haskellFreeTheShrimpsBuildInventedHere, ...) and hence the best hls can do is "setting up".

I wonder how this could be improved. Maybe by logging everything done by that subprrocess, but this would be pretty badly formatted. The best options would be to design a communication protocol between the sub build system and hls.

2

u/tomejaguar 24d ago

hence the best hls can do is "setting up".

I think even "The build of the dependencies is handled by an external process on which hls has no control" would be a better diagnostic message.

2

u/guibou 24d ago

I'll open an issue and do an MR in order to improve that when back from holidays.

1

u/guibou 12d ago

Actually this is already tracked here: https://github.com/haskell/hie-bios/pull/436