Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
Add an option to customize the typed holes settings
Browse files Browse the repository at this point in the history
Refinement hole fits are very cool, but currently too slow to enable at deeper
levels. It should eventually be user configurable.
  • Loading branch information
pepeiborra committed Sep 4, 2020
1 parent 43dedce commit 38f3afb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions session-loader/Development/IDE/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ loadSession dir = do
ShakeExtras{logger, eventer, restartShakeSession, withIndefiniteProgress
,ideNc, knownFilesVar, session=ideSession} <- getShakeExtras

IdeOptions{optTesting = IdeTesting optTesting, optCheckProject = CheckProject checkProject } <- getIdeOptions
IdeOptions{ optTesting = IdeTesting optTesting
, optCheckProject = CheckProject checkProject
, optCustomDynFlags
} <- getIdeOptions

-- Create a new HscEnv from a hieYaml root and a set of options
-- If the hieYaml file already has an HscEnv, the new component is
Expand All @@ -117,7 +120,7 @@ loadSession dir = do
-- Parse DynFlags for the newly discovered component
hscEnv <- emptyHscEnv ideNc libDir
(df, targets) <- evalGhcEnv hscEnv $
setOptions opts (hsc_dflags hscEnv)
first optCustomDynFlags <$> setOptions opts (hsc_dflags hscEnv)
let deps = componentDependencies opts ++ maybeToList hieYaml
dep_info <- getDependencyInfo deps
-- Now lookup to see whether we are combining with an existing HscEnv
Expand Down
4 changes: 4 additions & 0 deletions src/Development/IDE/Types/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ data IdeOptions = IdeOptions
-- Otherwise, return the result of parsing without Opt_Haddock, so
-- that the parsed module contains the result of Opt_KeepRawTokenStream,
-- which might be necessary for hlint.
, optCustomDynFlags :: DynFlags -> DynFlags
-- ^ If given, it will be called right after setting up a new cradle,
-- allowing to customize the Ghc options used
}

data OptHaddockParse = HaddockParse | NoHaddockParse
Expand Down Expand Up @@ -157,6 +160,7 @@ defaultIdeOptions session = IdeOptions
,optCheckProject = checkProject defaultLspConfig
,optCheckParents = checkParents defaultLspConfig
,optHaddockParse = HaddockParse
,optCustomDynFlags = id
}


Expand Down

0 comments on commit 38f3afb

Please sign in to comment.