Skip to content

Commit 32a40ad

Browse files
committed
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.
1 parent 7563439 commit 32a40ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ghcide/src/Development/IDE/GHC/Compat.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ setHieDir _f d = d { hieDir = Just _f}
434434
dontWriteHieFiles :: DynFlags -> DynFlags
435435
dontWriteHieFiles d = gopt_unset d Opt_WriteHie
436436

437-
setUpTypedHoles ::DynFlags -> DynFlags
437+
setUpTypedHoles :: DynFlags -> DynFlags
438438
setUpTypedHoles df
439439
= flip gopt_unset Opt_AbstractRefHoleFits -- too spammy
440440
$ flip gopt_unset Opt_ShowDocsOfHoleFits -- not used
@@ -449,7 +449,7 @@ setUpTypedHoles df
449449
$ df
450450
{ refLevelHoleFits = Just 1 -- becomes slow at higher levels
451451
, maxRefHoleFits = Just 10 -- quantity does not impact speed
452-
, maxValidHoleFits = Nothing -- quantity does not impact speed
452+
, maxValidHoleFits = Just 10 -- quantity does not impact speed
453453
}
454454

455455

0 commit comments

Comments
 (0)