Skip to content

Commit 0390106

Browse files
committed
Use loadModIface in ExportsMap creation
1 parent 1df58ae commit 0390106

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

ghcide/src/Development/IDE/Types/HscEnvEq.hs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,7 @@ newHscEnvEqWithImportPaths envImportPaths se hscEnv deps = do
102102
Just otherPkgMod -> otherPkgMod
103103
Nothing -> mkModule (unitInfoId pkg) modName
104104
]
105-
106-
doOne m = do
107-
modIface <- initIfaceLoad hscEnv $
108-
loadInterface "" m (ImportByUser NotBoot)
109-
return $ case modIface of
110-
Maybes.Failed _r -> Nothing
111-
Maybes.Succeeded mi -> Just mi
112-
modIfaces <- mapMaybeM doOne modules
105+
modIfaces <- mapMaybeM loadModIface modules
113106
return $ createExportsMap modIfaces
114107

115108
let dflags = hsc_dflags hscEnv
@@ -134,7 +127,7 @@ newHscEnvEqWithImportPaths envImportPaths se hscEnv deps = do
134127
(libraryDir : _) -> libraryDir
135128
hieDir :: FilePath
136129
hieDir = pkgLibDir </> "extra-compilation-artifacts"
137-
modIfaces <- mapMaybeM loadModIFace modules
130+
modIfaces <- mapMaybeM loadModIface modules
138131
traverse_ (indexModuleHieFile hieDir) modIfaces
139132
indexModuleHieFile :: FilePath -> ModIface -> IO ()
140133
indexModuleHieFile hieDir modIface = do
@@ -166,8 +159,8 @@ newHscEnvEqWithImportPaths envImportPaths se hscEnv deps = do
166159
. drop 1
167160
. words
168161
. show
169-
loadModIFace :: Module -> IO (Maybe ModIface)
170-
loadModIFace m = do
162+
loadModIface :: Module -> IO (Maybe ModIface)
163+
loadModIface m = do
171164
modIface <- initIfaceLoad hscEnv $
172165
loadInterface "" m (ImportByUser NotBoot)
173166
return $ case modIface of

0 commit comments

Comments
 (0)