Completing record selectors with RecordDotSyntax inserts invalid imports instead #4405
Labels
component: ghcide
Hackathon
This issue is suitable for hackathon sessions
type: bug
Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
In a record selector
(.foo.|)
(with|
indicating the cursor), if there is abar
completion indicating a.bar
field declared inBar
that would be valid there, HLS will treat this as a qualified import ofbar
and insert something likewhich 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)? NoThe text was updated successfully, but these errors were encountered: