Skip to content

Commit 533b0bf

Browse files
committed
format importes
1 parent 599bc47 commit 533b0bf

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ import Data.IORef
8787
import Data.IntMap.Strict (IntMap)
8888
import qualified Data.IntMap.Strict as IntMap
8989
import Data.List
90+
import Data.List.Extra (nubOrdOn)
91+
import Data.Map (Map)
9092
import qualified Data.Map as M
9193
import Data.Maybe
9294
import qualified Data.Rope.UTF16 as Rope
@@ -133,13 +135,13 @@ import Development.IDE.Types.Options
133135
import GHC.Generics (Generic)
134136
import GHC.IO.Encoding
135137
import qualified GHC.LanguageExtensions as LangExt
138+
import GhcPlugins (FinderCache, mgModSummaries)
136139
import qualified HieDb
137140
import Ide.Plugin.Config
138141
import qualified Language.LSP.Server as LSP
139142
import Language.LSP.Types (SMethod (SCustomMethod))
140143
import Language.LSP.VFS
141144
import System.Directory (canonicalizePath, makeAbsolute)
142-
143145
import Data.Default (def)
144146
import Ide.Plugin.Properties (HasProperty,
145147
KeyNameProxy,
@@ -149,13 +151,7 @@ import Ide.Plugin.Properties (HasProperty,
149151
import Ide.PluginUtils (configForPlugin)
150152
import Ide.Types (DynFlagsModifications (dynFlagsModifyGlobal, dynFlagsModifyParser),
151153
PluginId)
152-
import qualified Data.HashSet as HS
153-
import Unsafe.Coerce (unsafeCoerce)
154-
import Data.Map (Map)
155-
import GhcPlugins (FinderCache, mgModSummaries)
156-
import qualified Development.IDE.GHC.Compat as GHC
157-
import Development.IDE.GHC.Compat (installedModule)
158-
import Data.List.Extra (nubOrdOn)
154+
import Unsafe.Coerce (unsafeCoerce)
159155

160156
-- | This is useful for rules to convert rules that can only produce errors or
161157
-- a result into the more general IdeResult type that supports producing
@@ -340,7 +336,7 @@ getLocatedImportsRule =
340336
return $ if itExists then Just nfp' else Nothing
341337
| Just tt <- HM.lookup (TargetModule modName) targets = do
342338
-- reuse the existing NormalizedFilePath in order to maximize sharing
343-
let ttmap = HM.mapWithKey const (HS.toMap tt)
339+
let ttmap = HM.mapWithKey const (HashSet.toMap tt)
344340
nfp' = HM.lookupDefault nfp nfp ttmap
345341
itExists <- getFileExists nfp'
346342
return $ if itExists then Just nfp' else Nothing
@@ -730,11 +726,11 @@ ghcSessionDepsDefinition file = do
730726
mergeEnvs :: HscEnv -> [ModSummary] -> [HscEnv] -> IO HscEnv
731727
mergeEnvs env mss envs = do
732728
prevFinderCache <- concatFC <$> mapM (readIORef . hsc_FC) envs
733-
let ims = map (installedModule (homeUnitId_ $ hsc_dflags env) . moduleName . ms_mod) mss
729+
let ims = map (Compat.installedModule (homeUnitId_ $ hsc_dflags env) . moduleName . ms_mod) mss
734730
ifrs = zipWith (\ms -> InstalledFound (ms_location ms)) mss ims
735731
newFinderCache <- newIORef $
736732
foldl'
737-
(\fc (im, ifr) -> GHC.extendInstalledModuleEnv fc im ifr) prevFinderCache
733+
(\fc (im, ifr) -> Compat.extendInstalledModuleEnv fc im ifr) prevFinderCache
738734
$ zip ims ifrs
739735
return env{
740736
hsc_HPT = foldMap hsc_HPT envs,

0 commit comments

Comments
 (0)