@@ -7,6 +7,7 @@
7module Development.IDE.Types.Options
7module Development.IDE.Types.Options
8 ( IdeOptions(..)
8 ( IdeOptions(..)
9 , IdePkgLocationOptions(..)
9 , IdePkgLocationOptions(..)
10+ , InterfaceDirectory(..)
10 , defaultIdeOptions
11 , defaultIdeOptions
@@ -15,13 +16,16 @@ import GHC hiding (parseModule, typecheckModule)
15import GhcPlugins as GHC hiding (fst3, (<>))
16import GhcPlugins as GHC hiding (fst3, (<>))
19+-- | If `Nothing` we do not write .hi files.
20+newtype InterfaceDirectory = InterfaceDirectory (Maybe FilePath)
18data IdeOptions = IdeOptions
22data IdeOptions = IdeOptions
19 { optPreprocessor :: GHC.ParsedSource -> ([(GHC.SrcSpan, String)], GHC.ParsedSource)
23 { optPreprocessor :: GHC.ParsedSource -> ([(GHC.SrcSpan, String)], GHC.ParsedSource)
20 , optGhcSession :: Action HscEnv
24 , optGhcSession :: Action HscEnv
21 -- ^ Setup a GHC session using a given package state. If a `ParsedModule` is supplied,
25 -- ^ Setup a GHC session using a given package state. If a `ParsedModule` is supplied,
22 -- the import path should be setup for that module.
26 -- the import path should be setup for that module.
23 , optPkgLocationOpts :: IdePkgLocationOptions
27 , optPkgLocationOpts :: IdePkgLocationOptions
24− , optWriteIface :: Bool
28+ , optIfaceDir :: InterfaceDirectory
25 , optExtensions :: [String]
29 , optExtensions :: [String]
27 , optThreads :: Int
31 , optThreads :: Int
@@ -33,7 +37,7 @@ data IdeOptions = IdeOptions
33defaultIdeOptions :: Action HscEnv -> IdeOptions
37defaultIdeOptions :: Action HscEnv -> IdeOptions
34defaultIdeOptions session = IdeOptions
38defaultIdeOptions session = IdeOptions
35 {optPreprocessor = (,) []
39 {optPreprocessor = (,) []
36− ,optWriteIface = False
40+ ,optIfaceDir = InterfaceDirectory Nothing
37 ,optGhcSession = session
41 ,optGhcSession = session
38 ,optExtensions = ["hs"]
42 ,optExtensions = ["hs"]
39 ,optPkgLocationOpts = defaultIdePkgLocationOptions
43 ,optPkgLocationOpts = defaultIdePkgLocationOptions