@@ -87,6 +87,8 @@ import Data.IORef
87
87
import Data.IntMap.Strict (IntMap )
88
88
import qualified Data.IntMap.Strict as IntMap
89
89
import Data.List
90
+ import Data.List.Extra (nubOrdOn )
91
+ import Data.Map (Map )
90
92
import qualified Data.Map as M
91
93
import Data.Maybe
92
94
import qualified Data.Rope.UTF16 as Rope
@@ -133,13 +135,13 @@ import Development.IDE.Types.Options
133
135
import GHC.Generics (Generic )
134
136
import GHC.IO.Encoding
135
137
import qualified GHC.LanguageExtensions as LangExt
138
+ import GhcPlugins (FinderCache , mgModSummaries )
136
139
import qualified HieDb
137
140
import Ide.Plugin.Config
138
141
import qualified Language.LSP.Server as LSP
139
142
import Language.LSP.Types (SMethod (SCustomMethod ))
140
143
import Language.LSP.VFS
141
144
import System.Directory (canonicalizePath , makeAbsolute )
142
-
143
145
import Data.Default (def )
144
146
import Ide.Plugin.Properties (HasProperty ,
145
147
KeyNameProxy ,
@@ -149,13 +151,7 @@ import Ide.Plugin.Properties (HasProperty,
149
151
import Ide.PluginUtils (configForPlugin )
150
152
import Ide.Types (DynFlagsModifications (dynFlagsModifyGlobal , dynFlagsModifyParser ),
151
153
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 )
159
155
160
156
-- | This is useful for rules to convert rules that can only produce errors or
161
157
-- a result into the more general IdeResult type that supports producing
@@ -340,7 +336,7 @@ getLocatedImportsRule =
340
336
return $ if itExists then Just nfp' else Nothing
341
337
| Just tt <- HM. lookup (TargetModule modName) targets = do
342
338
-- 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)
344
340
nfp' = HM. lookupDefault nfp nfp ttmap
345
341
itExists <- getFileExists nfp'
346
342
return $ if itExists then Just nfp' else Nothing
@@ -730,11 +726,11 @@ ghcSessionDepsDefinition file = do
730
726
mergeEnvs :: HscEnv -> [ModSummary ] -> [HscEnv ] -> IO HscEnv
731
727
mergeEnvs env mss envs = do
732
728
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
734
730
ifrs = zipWith (\ ms -> InstalledFound (ms_location ms)) mss ims
735
731
newFinderCache <- newIORef $
736
732
foldl'
737
- (\ fc (im, ifr) -> GHC . extendInstalledModuleEnv fc im ifr) prevFinderCache
733
+ (\ fc (im, ifr) -> Compat . extendInstalledModuleEnv fc im ifr) prevFinderCache
738
734
$ zip ims ifrs
739
735
return env{
740
736
hsc_HPT = foldMap hsc_HPT envs,
0 commit comments