mrcjkb / haskell-tools.nvim

🦥 Supercharge your Haskell experience in neovim!
GNU General Public License v2.0
432 stars 18 forks source link

How to add import statements for variables on completion #358

Closed Hsiwe closed 3 months ago

Hsiwe commented 3 months ago

Question Hi! Probably a dumb question but how do I add imports on auto-complete? I have nvim-cmp+cmp-nvim-lsp configured and I have correct suggestions, for example: image

But when I confirm with cmp.confirm() it does not add any imports: image

Am I missing some setting or is it not possible? Thanks in advance!

mrcjkb commented 3 months ago

Hey 👋

This plugin doesn't do anything completion related, besides registering the cmp-nvim-lsp client capabilities if it detects that it's installed.

Auto import on confirm works for me (here's my personal config, but I don't remember what config you might need to enable or disable.

If you can't get it to work, I would suggest asking there. If it works with other languages, but not Haskell, it could be that the version of haskell-language-server you're using doesn't support it with your projects GHC version.

Hsiwe commented 3 months ago

I was using GHC 9.8.1 + HLS 2.6.0.0, after switching to GHC 9.8.2 + HLS 2.7.0.0 the problem was solved, thanks!