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

Applying a code action to a _ hole produces too many suggestions #4198

Open
mitchellwrosen opened this issue Apr 30, 2024 · 1 comment
Open
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. ZuriHac This issue is suitable for ZuriHac Hacking sessions

Comments

@mitchellwrosen
Copy link

I'm often using code actions to import out-of-scope identifiers. But sometimes I accidentally run a code action on a line that contains both an out-of-scope identifier and an underscore, such as:

TwoWay.twoWay (zipDefnsWith (alignWith _) undefined) conflicts
                             ^^^^^^^^^
                                this is out of scope, and I want HLS to suggest
                                `import Data.Semialign (alignWith)` with a code action.

In this case, the _ on the same line will cause 1800 (!) suggestions that look like

1: replace _ with foo
2: replace _ with bar
...

for (I guess?) every single identifier in scope.

@michaelpj michaelpj added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. ZuriHac This issue is suitable for ZuriHac Hacking sessions and removed status: needs triage type: enhancement New feature or request labels May 1, 2024
@michaelpj
Copy link
Collaborator

Many things weird here:

  • GHC shouldn't compute all this stuff
  • We should limit the number of things also

Also somewhat unclear why this is happening at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. ZuriHac This issue is suitable for ZuriHac Hacking sessions
Projects
Development

No branches or pull requests

2 participants