Skip to content

Commit fe20770

Browse files
committed
use set for old files
1 parent 7d38a6d commit fe20770

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ if impl(ghc >= 9.9)
5555
source-repository-package
5656
type: git
5757
location: https://github.com/soulomoon/hie-bios.git
58-
tag: 9b07c0804e1ef44e7ed64ca1ee2cf5818f8216bf
58+
tag: 45cfe1f4e1bac53e6d6f0cc98c3e8031d85c8e24

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ getHieDbLoc dir = do
436436
loadSessionWithOptions :: Recorder (WithPriority Log) -> SessionLoadingOptions -> FilePath -> TQueue (IO ()) -> IO (Action IdeGhcSession)
437437
loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
438438
let toAbsolutePath = toAbsolute rootDir -- see Note [Root Directory]
439-
cradle_files <- newIORef []
439+
cradle_files <- newIORef $ Set.empty
440440
-- Mapping from hie.yaml file to HscEnv, one per hie.yaml file
441441
hscEnvs <- newVar Map.empty :: IO (Var HieMap)
442442
-- Mapping from a Filepath to HscEnv
@@ -639,7 +639,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
639639
[] -> error $ "GHC version could not be parsed: " <> version
640640
((runTime, _):_)
641641
| compileTime == runTime -> do
642-
atomicModifyIORef' cradle_files (\xs -> (cfps<>xs,()))
642+
atomicModifyIORef' cradle_files (\xs -> (Set.fromList cfps<>xs,()))
643643
fmap (fmap Just) $ session (hieYaml, toNormalizedFilePath' <$> cfps, opts, libDir)
644644
| otherwise -> return ([(toNormalizedFilePath' cfp, (([renderPackageSetupException cfp GhcVersionMismatch{..}], Nothing), [])) | cfp <- cfps], Nothing)
645645
-- Failure case, either a cradle error or the none cradle
@@ -658,7 +658,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
658658
<> " (for " <> T.intercalate "," (T.pack <$> lfpLogs) <> ")"
659659
eoptsList <- mRunLspTCallback lspEnv (\act -> withIndefiniteProgress progMsg Nothing NotCancellable (const act)) $
660660
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)
662662
return res
663663
mapM (\(cr, hieYaml, fps, eopts) -> eoptsHscEnv (hieYaml, NE.toList fps, cr, eopts)) eoptsList
664664

0 commit comments

Comments
 (0)