Resolved: Missing HLS features in Emacs?

I use HLS in Emacs and I’m trying to understand where some features that I used to use have gone. I don’t know if HLS has removed those features or if Emacs has stopped giving me access to them. The features are

  • When a name is not in scope, offer to import it from a module it is defined in (even if that module is not yet imported). I think the set of modules it considered was all modules in all packages that the current project depends on.
  • Fill a typed hole with an expression of a matching type.

I used to access the features through C-c / (lsp-execute-code-action). Now I just get unhelpful options, such as “defer errors about missing names” (which I definitely don’t want). Maybe hole fits were disabled a long time ago? Or maybe not, because I see “Wingman tactics” as an enabled plugin under customize-group of lsp-haskell-plugins.
It’s also possible I’ve got a too old version of the lsp-haskell mode for Emacs (I’m on 3249cde from one year one month ago). But I don’t know. I’m just confused.

Can anyone shed any light?

1 Like

Oh, and I should probably say that I don’t know which HLS version was the one that worked, because although I have '(lsp-haskell-server-path "haskell-language-server-wrapper-2.4.0.0") in my .emacs configuration file, lsp-mode doesn’t actually seem to honor that. It just seems to load whatever version of HLS has been set as default in ghcup. I’ve also tried 2.5 and 2.6 and neither of them seem to support the missing features either. It’s possible that when they worked I was using a really old version of HLS, like 1.7, but I’ve deleted it now to free up disk space for the newer ones, so I can’t confirm …

perhaps related to this? It seems some plugins aren’t supported yet with 2.6.0.0 / GHC 9.8.

1 Like

That’s indeed the same problem I’m seeing, but it happens on 2.4 and 2.5 as well, not just 2.6, so I think something else must be happening.

Ah, but the problem is to do with GHC 9.8, not the HLS version. When I use 9.4 the actions are available. Thanks for that info @theGhostJW!

2 Likes

These two tables contain the relevant information, but you need to select the version of HLS that you are using
https://haskell-language-server.readthedocs.io/en/2.6.0.0/support/ghc-version-support.html#
https://haskell-language-server.readthedocs.io/en/2.6.0.0/support/plugin-support.html#

1 Like

Thanks, that’s very useful!