@@ -26,9 +26,6 @@ import GHC.Types.PkgQual
2626import GHC.Unit.State
2727import Data.Map.Strict (Map )
2828import qualified Data.Map.Strict as Map
29- import qualified Data.HashMap.Strict as HM
30- import qualified Data.HashSet as HashSet
31- import qualified Development.IDE.Types.KnownTargets as Shake
3229
3330
3431#if MIN_VERSION_ghc(9,11,0)
@@ -101,12 +98,12 @@ locateModule moduleMaps@(moduleMap, moduleMapSource) env comp_info exts modName
10198 ThisPkg uid
10299 -- TODO: there are MANY lookup on import_paths, which is a problem considering that it can be large.
103100 | Just (dirs, reexports) <- lookup uid import_paths
104- -> lookupLocal moduleMaps uid dirs reexports
101+ -> lookupLocal moduleMaps reexports
105102 | otherwise -> return $ Left $ notFoundErr env modName $ LookupNotFound []
106103 -- if a package name is given we only go look for a package
107104 OtherPkg uid
108105 | Just (dirs, reexports) <- lookup uid import_paths
109- -> lookupLocal moduleMaps uid dirs reexports
106+ -> lookupLocal moduleMaps reexports
110107 | otherwise -> lookupInPackageDB
111108 NoPkgQual -> do
112109
@@ -139,6 +136,7 @@ locateModule moduleMaps@(moduleMap, moduleMapSource) env comp_info exts modName
139136 where
140137 dflags = hsc_dflags env
141138 import_paths = mapMaybe (mkImportDirs env) comp_info
139+ {-
142140 other_imports =
143141 -- Instead of bringing all the units into scope, only bring into scope the units
144142 -- this one depends on.
@@ -157,14 +155,14 @@ locateModule moduleMaps@(moduleMap, moduleMapSource) env comp_info exts modName
157155 units = homeUnitEnv_units $ ue_findHomeUnitEnv (homeUnitId_ dflags) ue
158156 hpt_deps :: [UnitId]
159157 hpt_deps = homeUnitDepends units
158+ -}
160159
161160 toModLocation uid file = liftIO $ do
162161 loc <- mkHomeModLocation dflags (unLoc modName) (fromNormalizedFilePath file)
163162 let genMod = mkModule (RealUnit $ Definite uid) (unLoc modName) -- TODO support backpack holes
164163 return $ Right $ FileImport $ ArtifactsLocation file (Just loc) (not isSource) (Just genMod)
165164
166- lookupLocal moduleMaps@ (moduleMapSource, moduleMap) uid dirs reexports = do
167- -- mbFile <- locateModuleFile [(uid, dirs, reexports)] exts targetFor isSource $ unLoc modName
165+ lookupLocal moduleMaps@ (moduleMapSource, moduleMap) reexports = do
168166 let mbFile = case Map. lookup (unLoc modName) (if isSource then moduleMapSource else moduleMap) of
169167 Nothing -> LocateNotFound
170168 Just (uid, file) -> LocateFoundFile uid file
0 commit comments