@@ -840,6 +840,8 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
840
840
-- cleanup error loading files and cradle files
841
841
clearErrorLoadingFiles sessionState
842
842
clearCradleFiles sessionState
843
+ cacheKey <- invalidateShakeCache
844
+ restartShakeSession VFSUnmodified " didSessionLoadingPreferenceConfigChange" [] (return [cacheKey])
843
845
844
846
v <- atomically $ STM. lookup hieYaml (fileToFlags sessionState)
845
847
case v >>= HM. lookup (toNormalizedFilePath' file) of
@@ -870,20 +872,17 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
870
872
-- at a time. Therefore the IORef contains the currently running cradle, if we try
871
873
-- to get some more options then we wait for the currently running action to finish
872
874
-- before attempting to do so.
873
- let getOptions :: FilePath -> IO ()
874
- getOptions file = do
875
- let ncfp = toNormalizedFilePath' file
876
- cachedHieYamlLocation <- atomically $ STM. lookup ncfp (filesMap sessionState)
877
- hieYaml <- cradleLoc file
878
- let hieLoc = join cachedHieYamlLocation <|> hieYaml
879
- sessionOpts (hieLoc, file) `Safe.catch` handleSessionError sessionState hieLoc file
880
875
881
876
let getOptionsLoop :: IO ()
882
877
getOptionsLoop = do
883
878
-- Get the next file to load
884
- absFile <- atomically $ S. readQueue (pendingFileSet sessionState)
885
- logWith recorder Debug (LogGetOptionsLoop absFile)
886
- getOptions absFile
879
+ file <- atomically $ S. readQueue (pendingFileSet sessionState)
880
+ logWith recorder Debug (LogGetOptionsLoop file)
881
+ let ncfp = toNormalizedFilePath' file
882
+ cachedHieYamlLocation <- join <$> atomically (STM. lookup ncfp (filesMap sessionState))
883
+ hieYaml <- cradleLoc file
884
+ let hieLoc = cachedHieYamlLocation <|> hieYaml
885
+ sessionOpts (hieLoc, file) `Safe.catch` handleSessionError sessionState hieLoc file
887
886
getOptionsLoop
888
887
889
888
-- | Given a file, this function will return the HscEnv and the dependencies
0 commit comments