Skip to content

Commit 2270264

Browse files
committed
WIP fix: do not check for file existance when added to the context
This need to be investigated. The different `-boot` tests are flaky / failing in this MR because of this. Depending on "something" not yet understood, the file listed is `extendKnownTargets` as `newTargets` exists or not on the disk (checked with `doesFileExists`), leading to them added or not to the context. Removing the check makes the test succeed without breaking any other test.
1 parent 8a1f3d4 commit 2270264

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,14 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
476476
-- If we don't generate a TargetFile for each potential location, we will only have
477477
-- 'TargetFile Foo.hs' in the 'knownTargetsVar', thus not find 'TargetFile Foo.hs-boot'
478478
-- and also not find 'TargetModule Foo'.
479-
fs <- filterM (IO.doesFileExist . fromNormalizedFilePath) targetLocations
479+
-- fs <- filterM (IO.doesFileExist . fromNormalizedFilePath) targetLocations
480+
-- TODO: understand why there was this doesFileExists
481+
let fs = targetLocations
480482
pure $ map (\fp -> (TargetFile fp, Set.singleton fp)) (nubOrd (f:fs))
481483
TargetModule _ -> do
482-
found <- filterM (IO.doesFileExist . fromNormalizedFilePath) targetLocations
484+
-- found <- filterM (IO.doesFileExist . fromNormalizedFilePath) targetLocations
485+
-- TODO: understand why there was this doesFileExists
486+
let found = targetLocations
483487
return [(targetTarget, Set.fromList found)]
484488
hasUpdate <- atomically $ do
485489
known <- readTVar knownTargetsVar
@@ -764,6 +768,7 @@ data TargetDetails = TargetDetails
764768
targetDepends :: !DependencyInfo,
765769
targetLocations :: ![NormalizedFilePath]
766770
}
771+
deriving (Show)
767772

768773
fromTargetId :: [FilePath] -- ^ import paths
769774
-> [String] -- ^ extensions to consider

0 commit comments

Comments
 (0)