@@ -436,7 +436,7 @@ getHieDbLoc dir = do
436
436
loadSessionWithOptions :: Recorder (WithPriority Log ) -> SessionLoadingOptions -> FilePath -> TQueue (IO () ) -> IO (Action IdeGhcSession )
437
437
loadSessionWithOptions recorder SessionLoadingOptions {.. } rootDir que = do
438
438
let toAbsolutePath = toAbsolute rootDir -- see Note [Root Directory]
439
- cradle_files <- newIORef []
439
+ cradle_files <- newIORef $ Set. empty
440
440
-- Mapping from hie.yaml file to HscEnv, one per hie.yaml file
441
441
hscEnvs <- newVar Map. empty :: IO (Var HieMap )
442
442
-- Mapping from a Filepath to HscEnv
@@ -639,7 +639,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
639
639
[] -> error $ " GHC version could not be parsed: " <> version
640
640
((runTime, _): _)
641
641
| compileTime == runTime -> do
642
- atomicModifyIORef' cradle_files (\ xs -> (cfps<> xs,() ))
642
+ atomicModifyIORef' cradle_files (\ xs -> (Set. fromList cfps<> xs,() ))
643
643
fmap (fmap Just ) $ session (hieYaml, toNormalizedFilePath' <$> cfps, opts, libDir)
644
644
| otherwise -> return ([(toNormalizedFilePath' cfp, (([renderPackageSetupException cfp GhcVersionMismatch {.. }], Nothing ), [] )) | cfp <- cfps], Nothing )
645
645
-- Failure case, either a cradle error or the none cradle
@@ -658,7 +658,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
658
658
<> " (for " <> T. intercalate " ," (T. pack <$> lfpLogs) <> " )"
659
659
eoptsList <- mRunLspTCallback lspEnv (\ act -> withIndefiniteProgress progMsg Nothing NotCancellable (const act)) $
660
660
do old_files <- readIORef cradle_files
661
- res <- cradleToOptsAndLibDirs recorder (sessionLoading clientConfig) cradles old_files
661
+ res <- cradleToOptsAndLibDirs recorder (sessionLoading clientConfig) cradles ( Set. toList old_files)
662
662
return res
663
663
mapM (\ (cr, hieYaml, fps, eopts) -> eoptsHscEnv (hieYaml, NE. toList fps, cr, eopts)) eoptsList
664
664
0 commit comments