Skip to content

Commit b430b94

Browse files
committed
Remove 'setupFinderCache' as its never actually used
1 parent c024d96 commit b430b94

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ module Development.IDE.Core.Compile
2727
, loadHieFile
2828
, loadInterface
2929
, loadModulesHome
30-
, setupFinderCache
3130
, getDocsBatch
3231
, lookupName
3332
,mergeEnvs) where
@@ -654,30 +653,6 @@ handleGenerationErrors' dflags source action =
654653
. (("Error during " ++ T.unpack source) ++) . show @SomeException
655654
]
656655

657-
-- | Initialise the finder cache, dependencies should be topologically
658-
-- sorted.
659-
setupFinderCache :: [ModSummary] -> HscEnv -> IO HscEnv
660-
setupFinderCache mss session = do
661-
662-
-- Make modules available for others that import them,
663-
-- by putting them in the finder cache.
664-
let ims = map (installedModule (homeUnitId_ $ hsc_dflags session) . moduleName . ms_mod) mss
665-
ifrs = zipWith (\ms -> InstalledFound (ms_location ms)) mss ims
666-
-- set the target and module graph in the session
667-
graph = mkModuleGraph mss
668-
669-
-- We have to create a new IORef here instead of modifying the existing IORef as
670-
-- it is shared between concurrent compilations.
671-
prevFinderCache <- readIORef $ hsc_FC session
672-
let newFinderCache =
673-
foldl'
674-
(\fc (im, ifr) -> GHC.extendInstalledModuleEnv fc im ifr) prevFinderCache
675-
$ zip ims ifrs
676-
newFinderCacheVar <- newIORef $! newFinderCache
677-
678-
pure $ session { hsc_FC = newFinderCacheVar, hsc_mod_graph = graph }
679-
680-
681656
-- | Load modules, quickly. Input doesn't need to be desugared.
682657
-- A module must be loaded before dependent modules can be typechecked.
683658
-- This variant of loadModuleHome will *never* cause recompilation, it just

0 commit comments

Comments
 (0)