Commit 7b8e2e5
Limit number of valid hole fits to 10 (#4288)
* ghcide: Pass -fmax-valid-hole-fits=10 to GHC
In cases where GHC doesn't know anything about the type of a hole, it suggests
every available symbol as a hole fit, which can cause editors to crash or at
least be very slow. 10 seems to be a fair number to limit hole fits to.
* hls-refactor-plugin: Ignore "Some hole fits suppressed" message when valid hole fits are limited
* hls-refactor-plugin: More predictable hole fit for test
Now that we limit number of hole fits recommended by GHC, the test that
hopes to find `+` being recommended for `Int -> Int -> Int` becomes
unpredictable because there are too many symbols which match that type
and the sorting has little control over which symbols get recommended.
There are way fewer matches for `(Int -> Maybe Int) -> Maybe Int ->
Maybe Int`, so it makes the test consistently succeed.
---------
Co-authored-by: Michael Peyton Jones <[email protected]>1 parent 026d0ce commit 7b8e2e5
File tree
3 files changed
+19
-13
lines changed- ghcide/src/Development/IDE/GHC
- plugins/hls-refactor-plugin
- src/Development/IDE/Plugin/Plugins
- test
3 files changed
+19
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| |||
434 | 435 | | |
435 | 436 | | |
436 | 437 | | |
437 | | - | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| |||
447 | 448 | | |
448 | 449 | | |
449 | 450 | | |
450 | | - | |
451 | | - | |
452 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2640 | 2640 | | |
2641 | 2641 | | |
2642 | 2642 | | |
2643 | | - | |
2644 | | - | |
| 2643 | + | |
| 2644 | + | |
2645 | 2645 | | |
2646 | 2646 | | |
2647 | 2647 | | |
2648 | 2648 | | |
2649 | | - | |
| 2649 | + | |
2650 | 2650 | | |
2651 | 2651 | | |
2652 | | - | |
| 2652 | + | |
2653 | 2653 | | |
2654 | 2654 | | |
2655 | 2655 | | |
2656 | | - | |
2657 | | - | |
| 2656 | + | |
| 2657 | + | |
2658 | 2658 | | |
2659 | 2659 | | |
2660 | 2660 | | |
2661 | 2661 | | |
2662 | | - | |
| 2662 | + | |
2663 | 2663 | | |
2664 | 2664 | | |
2665 | | - | |
| 2665 | + | |
2666 | 2666 | | |
2667 | 2667 | | |
2668 | 2668 | | |
| |||
0 commit comments