Skip to content

Share ModuleGraphs for all files #3232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Errors
  • Loading branch information
wz1000 committed Aug 2, 2023
commit 9aea2f6849be0d89a01c60f52a1531219bbeb95a
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