Skip to content

Commit 31757fe

Browse files
committed
Limit the number of valid hole fits
Originally haskell/ghcide#888
1 parent 7d7c2ef commit 31757fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ import Data.List (foldl')
184184
import Data.List (foldl', isSuffixOf)
185185
#endif
186186

187+
import Control.Applicative ((<|>))
187188
import qualified Data.Map as M
188189
import DynamicLoading
189190
import Plugins (Plugin (parsedResultAction),
@@ -303,7 +304,7 @@ setUpTypedHoles df
303304
$ df
304305
{ refLevelHoleFits = Just 1 -- becomes slow at higher levels
305306
, maxRefHoleFits = Just 10 -- quantity does not impact speed
306-
, maxValidHoleFits = Nothing -- quantity does not impact speed
307+
, maxValidHoleFits = maxValidHoleFits df <|> Just 10 -- quantity does not impact speed
307308
}
308309

309310

0 commit comments

Comments
 (0)