Skip to content

Commit 7314509

Browse files
committed
refactor session loading to handle dependency checks more clearly
1 parent 6139522 commit 7314509

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,8 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
753753
case HM.lookup (toNormalizedFilePath' file) v of
754754
Just (_opts, old_di) -> do
755755
deps_ok <- checkDependencyInfo old_di
756-
when (not deps_ok) $ do
756+
if (not deps_ok)
757+
then do
757758
-- if deps are old, we can try to load the error files again
758759
atomicModifyIORef' error_loading_files (\xs -> (Set.delete file xs,()))
759760
atomicModifyIORef' cradle_files (\xs -> (Set.delete file xs,()))
@@ -765,6 +766,8 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
765766
-- Keep the same name cache
766767
modifyVar_ hscEnvs (return . Map.adjust (const []) hieYaml )
767768
consultCradle hieYaml file
769+
-- if deps are ok, we can just remove the file from pending files
770+
else atomically $ S.delete file pendingFileSet
768771
Nothing -> consultCradle hieYaml file
769772

770773
let checkInCache ::NormalizedFilePath -> STM (Maybe (IdeResult HscEnvEq, DependencyInfo))

0 commit comments

Comments
 (0)