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

Limit the number of valid hole fits #1914

Closed
wants to merge 14 commits into from
12 changes: 9 additions & 3 deletions ghcide/src/Development/IDE/GHC/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ import qualified Avail
#if MIN_VERSION_ghc(8,8,0)
import StringBuffer (hPutStringBuffer)
#endif

import qualified Data.Map as M
import DynamicLoading
import Plugins (Plugin (parsedResultAction),
withPlugins)
import qualified SysTools

#if !MIN_VERSION_ghc(8,8,0)
Expand All @@ -110,6 +115,7 @@ import Data.IORef

import qualified Data.Map as Map
import Data.List (foldl')
import Control.Applicative ((<|>))

#if MIN_VERSION_ghc(9,0,0)
import qualified Data.Set as S
Expand Down Expand Up @@ -193,9 +199,9 @@ setUpTypedHoles df
$ flip gopt_unset Opt_SortValidHoleFits
$ flip gopt_unset Opt_UnclutterValidHoleFits
$ df
{ refLevelHoleFits = Just 1 -- becomes slow at higher levels
, maxRefHoleFits = Just 10 -- quantity does not impact speed
, maxValidHoleFits = Nothing -- quantity does not impact speed
{ refLevelHoleFits = refLevelHoleFits df <|> Just 1 -- becomes slow at higher levels
, maxRefHoleFits = maxRefHoleFits df <|> Just 10 -- quantity does not impact speed
, maxValidHoleFits = maxValidHoleFits df <|> Just 10 -- quantity does not impact speed
}


Expand Down