Skip to content

Commit

Permalink
Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wz1000 committed Aug 2, 2023
1 parent 88d7f7c commit 9aea2f6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/hls-eval-plugin/src/Ide/Plugin/Eval/CodeLens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -246,21 +246,21 @@ runEvalCmd plId st EvalParams{..} =
-- also be loaded into the environment.
--
-- The interactive context and interactive dynamic flags are also set appropiately.
initialiseSessionForEval :: Bool -> IdeState -> NormalizedFilePath -> ExceptT PluginError (LspM Config) HscEnv
initialiseSessionForEval :: Bool -> IdeState -> NormalizedFilePath -> IO HscEnv
initialiseSessionForEval needs_quickcheck st nfp = do
(ms, env1) <- runActionE "runEvalCmd" st $ do
(ms, env1) <- runAction "runEvalCmd" st $ do

ms <- msrModSummary <$> useE GetModSummary nfp
deps_hsc <- hscEnv <$> useE GhcSessionDeps nfp
ms <- msrModSummary <$> use_ GetModSummary nfp
deps_hsc <- hscEnv <$> use_ GhcSessionDeps nfp

linkables_needed <- transitiveDeps <$> useNoFile_ GetModuleGraph <*> pure nfp
linkables <- usesE GetLinkable (nfp : maybe [] transitiveModuleDeps linkables_needed)
linkables <- uses_ GetLinkable (nfp : maybe [] transitiveModuleDeps linkables_needed)
-- We unset the global rdr env in mi_globals when we generate interfaces
-- See Note [Clearing mi_globals after generating an iface]
-- However, the eval plugin (setContext specifically) requires the rdr_env
-- for the current module - so get it from the Typechecked Module and add
-- it back to the iface for the current module.
rdr_env <- tcg_rdr_env . tmrTypechecked <$> useE TypeCheck nfp
rdr_env <- tcg_rdr_env . tmrTypechecked <$> use_ TypeCheck nfp
let linkable_hsc = loadModulesHome (map (addRdrEnv . linkableHomeMod) linkables) deps_hsc
addRdrEnv hmi
| iface <- hm_iface hmi
Expand Down

0 comments on commit 9aea2f6

Please sign in to comment.