@@ -15,7 +15,7 @@ module Development.IDE.Types.Options
1515 , IdeResult
1616 , IdeGhcSession (.. )
1717 , OptHaddockParse (.. )
18- ) where
18+ , optShakeFiles ) where
1919
2020import Data.Default
2121import Development.Shake
@@ -50,12 +50,6 @@ data IdeOptions = IdeOptions
5050 -- ^ How to locate source and @.hie@ files given a module name.
5151 , optExtensions :: [String ]
5252 -- ^ File extensions to search for code, defaults to Haskell sources (including @.hs@)
53-
54- , optThreads :: Int
55- -- ^ Number of threads to use. Use 0 for number of threads on the machine.
56- , optShakeFiles :: Maybe FilePath
57- -- ^ Directory where the shake database should be stored. For ghcide this is always set to `Nothing` for now
58- -- meaning we keep everything in memory but the daml CLI compiler uses this for incremental builds.
5953 , optShakeProfiling :: Maybe FilePath
6054 -- ^ Set to 'Just' to create a directory of profiling reports.
6155 , optOTMemoryProfiling :: IdeOTMemoryProfiling
@@ -90,8 +84,16 @@ data IdeOptions = IdeOptions
9084 , optCustomDynFlags :: DynFlags -> DynFlags
9185 -- ^ Will be called right after setting up a new cradle,
9286 -- allowing to customize the Ghc options used
87+ , optShakeOptions :: ShakeOptions
9388 }
9489
90+ optShakeFiles :: IdeOptions -> Maybe FilePath
91+ optShakeFiles opts
92+ | value == defValue = Nothing
93+ | otherwise = Just value
94+ where
95+ value = shakeFiles (optShakeOptions opts)
96+ defValue = shakeFiles (optShakeOptions $ defaultIdeOptions undefined )
9597data OptHaddockParse = HaddockParse | NoHaddockParse
9698 deriving (Eq ,Ord ,Show ,Enum )
9799
@@ -119,8 +121,10 @@ defaultIdeOptions session = IdeOptions
119121 ,optGhcSession = session
120122 ,optExtensions = [" hs" , " lhs" ]
121123 ,optPkgLocationOpts = defaultIdePkgLocationOptions
122- ,optThreads = 0
123- ,optShakeFiles = Nothing
124+ ,optShakeOptions = shakeOptions
125+ {shakeThreads = 0
126+ ,shakeFiles = " /dev/null"
127+ }
124128 ,optShakeProfiling = Nothing
125129 ,optOTMemoryProfiling = IdeOTMemoryProfiling False
126130 ,optReportProgress = IdeReportProgress False
0 commit comments