haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.65k stars 355 forks source link

Limit number of valid hole fits to 10 #4288

Closed akshaymankar closed 3 months ago

akshaymankar commented 3 months ago

Fixes #4198 Supersedes #1914

michaelpj commented 3 months ago

Genuine test failure in hls-refactor-plugin, it's looking for a hole-fit suggestion code action that presumably now gets filtered out. Not sure quite how we want to fix this - we could change the test to look for one that does get selected, or maybe we should just increase the number of fits to 20 or something.

akshaymankar commented 3 months ago

Genuine test failure in hls-refactor-plugin, it's looking for a hole-fit suggestion code action that presumably now gets filtered out. Not sure quite how we want to fix this - we could change the test to look for one that does get selected, or maybe we should just increase the number of fits to 20 or something.

Just replaced the test with a type which has fewer hole-fits. For me getting 20 code suggestions for a hole feels a bit overwhelming (10 is already pushing it honestly), but its just a feeling.

michaelpj commented 3 months ago

Great, happy to take your read on the UX.

Tritlo commented 3 months ago

Hmm. Does this then now not inform the users when there are hole-fits found but are suppressed by this setting? That seems confusing and counterintuitive, though I might be biased.

michaelpj commented 3 months ago

This doesn't change how the normal diagnostic from GHC is produced, I think.

akshaymankar commented 3 months ago

We do get this info from GHC that some hole-fits are suppressed. I don't know what would be a good way to communicate this info.

michaelpj commented 3 months ago

If you mean e.g. in offering completions, I don't think we have a good way of conveying that information...