File tree 2 files changed +6
-10
lines changed
ghcide/src/Development/IDE/Core 2 files changed +6
-10
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 @@ -694,8 +694,7 @@ typeCheckRuleDefinition hsc pm = do
694
694
695
695
unlift <- askUnliftIO
696
696
let dets = TypecheckHelpers
697
- { getLinkablesToKeep = unliftIO unlift currentLinkables
698
- , getLinkables = unliftIO unlift . uses_ GetLinkable
697
+ { getLinkables = unliftIO unlift . uses_ GetLinkable
699
698
}
700
699
addUsageDependencies $ liftIO $
701
700
typecheckModule defer hsc dets pm
@@ -1108,7 +1107,10 @@ getLinkableRule recorder =
1108
1107
-- Record the linkable so we know not to unload it
1109
1108
whenJust (hm_linkable =<< hmi) $ \ (LM time mod _) -> do
1110
1109
compiledLinkables <- getCompiledLinkables <$> getIdeGlobalAction
1111
- liftIO $ void $ modifyVar' compiledLinkables $ \ old -> extendModuleEnv old mod time
1110
+ liftIO $ modifyVar compiledLinkables $ \ old -> do
1111
+ let ! to_keep = extendModuleEnv old mod time
1112
+ unload (hscEnv session) (map (\ (mod , time) -> LM time mod [] ) $ moduleEnvToList to_keep)
1113
+ return (to_keep, () )
1112
1114
return (hash <$ hmi, (warns, LinkableResult <$> hmi <*> pure hash))
1113
1115
1114
1116
-- | 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