Description
In a record selector (.foo.|)
(with |
indicating the cursor), if there is a bar
completion indicating a .bar
field declared in Bar
that would be valid there, HLS will treat this as a qualified import of bar
and insert something like
import Bar as foo
f = (.foo.bar|)
which is syntactically invalid. I would expect the same completion but without the invalid import.
Although not ideal, a quick fix for this within HLS could be for the "add import" feature to simply warn/error on syntactically invalid requests.
Your environment
Which OS do you use? NixOS
Which version of GHC do you use and how did you install it? 9.8.2, via Nix
How is your project built? cabal
Which LSP client (editor/plugin) do you use? emacs with lsp-mode
Which version of HLS do you use and how did you install it? 2.9.0.0, via Nix
Have you configured HLS in any way (especially: a hie.yaml
file)? No