Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completing record selectors with RecordDotSyntax inserts invalid imports instead #4405

Open
evertedsphere opened this issue Sep 18, 2024 · 0 comments
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..

Comments

@evertedsphere
Copy link

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

@evertedsphere evertedsphere added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Sep 18, 2024
@fendor fendor added component: ghcide Hackathon This issue is suitable for hackathon sessions and removed status: needs triage labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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..
Projects
None yet
Development

No branches or pull requests

2 participants