File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
ghcide/session-loader/Development/IDE Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -782,16 +782,16 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
782
782
-- what if the error to load file is one of old_files ?
783
783
let attemptToLoadFiles = Set. delete cfp $ Set. fromList $ concatMap cradleErrorLoadingFiles err
784
784
old_files <- readIORef (cradle_files sessionState)
785
- let errorToLoadNewFiles = attemptToLoadFiles `Set.difference` old_files
786
- if not ( null errorToLoadNewFiles)
785
+ let errorToLoadNewFiles = cfp : Set. toList ( attemptToLoadFiles `Set.difference` old_files)
786
+ if length errorToLoadNewFiles > 1
787
787
then do
788
788
-- we are loading more files and failed, we need to retry
789
789
-- mark as less loaded files as failedLoadingFiles as possible
790
790
-- limitation is that when we are loading files, and the dependencies of old_files
791
791
-- are changed, and old_files are not valid anymore.
792
792
-- but they will still be in the old_files, and will not move to error_loading_files.
793
793
-- And make other files failed to load in batch mode.
794
- addErrorLoadingFiles sessionState ( Set. toList errorToLoadNewFiles)
794
+ addErrorLoadingFiles sessionState errorToLoadNewFiles
795
795
-- retry without other files
796
796
logWith recorder Info $ LogSessionReloadOnError cfp (Set. toList attemptToLoadFiles)
797
797
consultCradle hieYaml cfp
You can’t perform that action at this time.
0 commit comments