on master help sign in
Import the IDE modules unqualified instead of as Compile(rService) (#2227)

Some `Development.IDE.*` modules were imported qualified as either `Compile` or `CompilerService`. These names are at least odd and maybe also misleading. Since there's no actual need to import them qualified, let's just import them not qualified.

commitb2380eac70305eb743f858b3adf68224404d4c83 authorMartin Huschenbett <martin.huschenbett@posteo.me> dateFri 19 Jul 2019, 12:05 (7 years ago) parent2a7aaa9
1 file changed+13−13
src/Development/IDE/Core/Rules.hs+13−13
src/Development/IDE/Core/Rules.hs+13−13
@@ -28,9 +28,9 @@ module Development.IDE.Core.Rules(
2828
2929import Control.Monad.Except
3030import Control.Monad.Trans.Maybe
31−import qualified Development.IDE.Core.Compile as Compile
32−import qualified Development.IDE.Types.Options as Compile
33−import qualified Development.IDE.Spans.Calculate as Compile
31+import Development.IDE.Core.Compile
32+import Development.IDE.Types.Options
33+import Development.IDE.Spans.Calculate
3434import Development.IDE.Import.DependencyInformation
3535import Development.IDE.Import.FindImports
3636import Development.IDE.Core.FileStore
@@ -47,7 +47,7 @@ import Development.IDE.GHC.Error
4747import Development.Shake hiding (Diagnostic, Env, newCache)
4848import Development.IDE.Core.RuleTypes
4949
50−import GHC
50+import GHC hiding (parseModule, typecheckModule)
5151import Development.IDE.GHC.Compat
5252import UniqSupply
5353import NameCache
@@ -105,7 +105,7 @@ getAtPoint file pos = fmap join $ runMaybeT $ do
105105 files <- transitiveModuleDeps <$> useE GetDependencies file
106106 tms <- usesE TypeCheck (file : files)
107107 spans <- useE GetSpanInfo file
108− return $ AtPoint.atPoint opts (map Compile.tmrModule tms) spans pos
108+ return $ AtPoint.atPoint opts (map tmrModule tms) spans pos
109109
110110-- | Goto Definition.
111111getDefinition :: NormalizedFilePath -> Position -> Action (Maybe Location)
@@ -140,7 +140,7 @@ getParsedModuleRule =
140140 (_, contents) <- getFileContents file
141141 packageState <- useNoFile_ GhcSession
142142 opt <- getIdeOptions
143− liftIO $ Compile.parseModule opt packageState (fromNormalizedFilePath file) contents
143+ liftIO $ parseModule opt packageState (fromNormalizedFilePath file) contents
144144
145145getLocatedImportsRule :: Rules ()
146146getLocatedImportsRule =
@@ -149,10 +149,10 @@ getLocatedImportsRule =
149149 let ms = pm_mod_summary pm
150150 let imports = ms_textual_imps ms
151151 env <- useNoFile_ GhcSession
152− let dflags = Compile.addRelativeImport pm $ hsc_dflags env
152+ let dflags = addRelativeImport pm $ hsc_dflags env
153153 opt <- getIdeOptions
154154 xs <- forM imports $ \(mbPkgName, modName) ->
155− (modName, ) <$> locateModule dflags (Compile.optExtensions opt) getFileExists modName mbPkgName
155+ (modName, ) <$> locateModule dflags (optExtensions opt) getFileExists modName mbPkgName
156156 return (concat $ lefts $ map snd xs, Just $ map (second eitherToMaybe) xs)
157157
158158
@@ -174,7 +174,7 @@ rawDependencyInformation f = go (Set.singleton f) Map.empty Map.empty
174174 modOrPkgImports <- forM imports $ \imp -> do
175175 case imp of
176176 (_modName, Just (PackageImport pkg)) -> do
177− pkgs <- ExceptT $ liftIO $ Compile.computePackageDeps packageState pkg
177+ pkgs <- ExceptT $ liftIO $ computePackageDeps packageState pkg
178178 pure $ Right $ pkg:pkgs
179179 (modName, Just (FileImport absFile)) -> pure $ Left (modName, Just absFile)
180180 (modName, Nothing) -> pure $ Left (modName, Nothing)
@@ -237,7 +237,7 @@ getSpanInfoRule =
237237 tc <- use_ TypeCheck file
238238 imports <- use_ GetLocatedImports file
239239 packageState <- useNoFile_ GhcSession
240− x <- liftIO $ Compile.getSrcSpanInfos packageState (fileImports imports) tc
240+ x <- liftIO $ getSrcSpanInfos packageState (fileImports imports) tc
241241 return ([], Just x)
242242
243243-- Typechecks a module.
@@ -250,7 +250,7 @@ typeCheckRule =
250250 setPriority priorityTypeCheck
251251 packageState <- useNoFile_ GhcSession
252252 opt <- getIdeOptions
253− liftIO $ Compile.typecheckModule opt packageState tms pm
253+ liftIO $ typecheckModule opt packageState tms pm
254254
255255
256256generateCoreRule :: Rules ()
@@ -260,13 +260,13 @@ generateCoreRule =
260260 (tm:tms) <- uses_ TypeCheck (file:transitiveModuleDeps deps)
261261 setPriority priorityGenerateCore
262262 packageState <- useNoFile_ GhcSession
263− liftIO $ Compile.compileModule packageState tms tm
263+ liftIO $ compileModule packageState tms tm
264264
265265loadGhcSession :: Rules ()
266266loadGhcSession =
267267 defineNoFile $ \GhcSession -> do
268268 opts <- getIdeOptions
269− Compile.optGhcSession opts
269+ optGhcSession opts
270270
271271
272272getHieFileRule :: Rules ()