Skip to content

Commit 8271db4

Browse files
authored
Remove redudant absolutization in session loader (#4280)
1 parent 71aa2d3 commit 8271db4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -811,20 +811,19 @@ fromTargetId :: [FilePath] -- ^ import paths
811811
-> TargetId
812812
-> IdeResult HscEnvEq
813813
-> DependencyInfo
814-
-> FilePath -- ^ root dir, see Note [Root Directory]
815814
-> IO [TargetDetails]
816815
-- For a target module we consider all the import paths
817-
fromTargetId is exts (GHC.TargetModule modName) env dep dir = do
816+
fromTargetId is exts (GHC.TargetModule modName) env dep = do
818817
let fps = [i </> moduleNameSlashes modName -<.> ext <> boot
819818
| ext <- exts
820819
, i <- is
821820
, boot <- ["", "-boot"]
822821
]
823-
let locs = fmap (toNormalizedFilePath' . toAbsolute dir) fps
822+
let locs = fmap toNormalizedFilePath' fps
824823
return [TargetDetails (TargetModule modName) env dep locs]
825824
-- For a 'TargetFile' we consider all the possible module names
826-
fromTargetId _ _ (GHC.TargetFile f _) env deps dir = do
827-
let nf = toNormalizedFilePath' $ toAbsolute dir f
825+
fromTargetId _ _ (GHC.TargetFile f _) env deps = do
826+
let nf = toNormalizedFilePath' f
828827
let other
829828
| "-boot" `isSuffixOf` f = toNormalizedFilePath' (L.dropEnd 5 $ fromNormalizedFilePath nf)
830829
| otherwise = toNormalizedFilePath' (fromNormalizedFilePath nf ++ "-boot")
@@ -985,7 +984,7 @@ newComponentCache recorder exts cradlePath _cfp hsc_env old_cis new_cis dir = do
985984
logWith recorder Debug $ LogNewComponentCache (targetEnv, targetDepends)
986985
evaluate $ liftRnf rwhnf $ componentTargets ci
987986

988-
let mk t = fromTargetId (importPaths df) exts (targetId t) targetEnv targetDepends dir
987+
let mk t = fromTargetId (importPaths df) exts (targetId t) targetEnv targetDepends
989988
ctargets <- concatMapM mk (componentTargets ci)
990989

991990
return (L.nubOrdOn targetTarget ctargets)

0 commit comments

Comments
 (0)