Skip to content

Commit f817d89

Browse files
committed
WIP fix: do not check for file existance when added to the context and
add all alternate file to knownFiles This need to be investigated. The different `-boot` tests are flaky / failing in this MR because of this. WIP: remove debug statments
1 parent 8a1f3d4 commit f817d89

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@ 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
480-
pure $ map (\fp -> (TargetFile fp, Set.singleton fp)) (nubOrd (f:fs))
479+
pure $ do
480+
file <- nubOrd (f:targetLocations)
481+
pure $ (TargetFile file, Set.singleton file)
481482
TargetModule _ -> do
482483
found <- filterM (IO.doesFileExist . fromNormalizedFilePath) targetLocations
483484
return [(targetTarget, Set.fromList found)]
@@ -764,6 +765,7 @@ data TargetDetails = TargetDetails
764765
targetDepends :: !DependencyInfo,
765766
targetLocations :: ![NormalizedFilePath]
766767
}
768+
deriving (Show)
767769

768770
fromTargetId :: [FilePath] -- ^ import paths
769771
-> [String] -- ^ extensions to consider

0 commit comments

Comments
 (0)