File tree 2 files changed +5
-8
lines changed
ghcide/src/Development/IDE/Core
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -160,8 +160,7 @@ computePackageDeps env pkg = do
160
160
161
161
data TypecheckHelpers
162
162
= TypecheckHelpers
163
- { getLinkablesToKeep :: ! (IO (ModuleEnv UTCTime ))
164
- , getLinkables :: ! ([NormalizedFilePath ] -> IO [LinkableResult ])
163
+ { getLinkables :: ! ([NormalizedFilePath ] -> IO [LinkableResult ])
165
164
}
166
165
167
166
typecheckModule :: IdeDefer
@@ -327,11 +326,6 @@ captureSplicesAndDeps TypecheckHelpers{..} env k = do
327
326
]
328
327
; let hsc_env' = loadModulesHome (map linkableHomeMod lbs) hsc_env
329
328
330
- -- Essential to do this here after we load the linkables
331
- ; keep_lbls <- getLinkablesToKeep
332
-
333
- ; unload hsc_env' $ map (\ (mod , time) -> LM time mod [] ) $ moduleEnvToList keep_lbls
334
-
335
329
#if MIN_VERSION_ghc(9,3,0)
336
330
{- load it -}
337
331
; (fv_hvs, lbss, pkgs) <- loadDecls (hscInterp hsc_env') hsc_env' srcspan bcos
Original file line number Diff line number Diff line change @@ -1119,7 +1119,10 @@ getLinkableRule recorder =
1119
1119
-- Record the linkable so we know not to unload it
1120
1120
whenJust (hm_linkable =<< hmi) $ \ (LM time mod _) -> do
1121
1121
compiledLinkables <- getCompiledLinkables <$> getIdeGlobalAction
1122
- liftIO $ void $ modifyVar' compiledLinkables $ \ old -> extendModuleEnv old mod time
1122
+ liftIO $ modifyVar compiledLinkables $ \ old -> do
1123
+ let ! to_keep = extendModuleEnv old mod time
1124
+ unload (hscEnv session) (map (\ (mod , time) -> LM time mod [] ) $ moduleEnvToList to_keep)
1125
+ return (to_keep, () )
1123
1126
return (hash <$ hmi, (warns, LinkableResult <$> hmi <*> pure hash))
1124
1127
1125
1128
-- | For now we always use bytecode unless something uses unboxed sums and tuples along with TH
You can’t perform that action at this time.
0 commit comments