diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-12-14 11:23:02 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-12-21 01:46:39 -0500 |
commit | 9728d6c2b62f38f79c8833b1819200985fe173dc (patch) | |
tree | 8e44abae10080473b22ad71f750613cdc1fa9a96 /compiler/GHC/Driver/Main.hs | |
parent | 00b55bfcd982bed2c9fc02d9c3ca66ba9d41bb5c (diff) | |
download | haskell-9728d6c2b62f38f79c8833b1819200985fe173dc.tar.gz |
Give plugins a better interface (#17957)
Plugins were directly fetched from HscEnv (hsc_static_plugins and
hsc_plugins). The tight coupling of plugins and of HscEnv is undesirable
and it's better to store them in a new Plugins datatype and to use it in
the plugins' API (e.g. withPlugins, mapPlugins...).
In the process, the interactive context (used by GHCi) got proper
support for different static plugins than those used for loaded modules.
Bump haddock submodule
Diffstat (limited to 'compiler/GHC/Driver/Main.hs')
-rw-r--r-- | compiler/GHC/Driver/Main.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs index c403b3e85a..39c1f7af4e 100644 --- a/compiler/GHC/Driver/Main.hs +++ b/compiler/GHC/Driver/Main.hs @@ -265,8 +265,7 @@ newHscEnv dflags = do , hsc_type_env_vars = emptyKnotVars , hsc_interp = Nothing , hsc_unit_env = unit_env - , hsc_plugins = [] - , hsc_static_plugins = [] + , hsc_plugins = emptyPlugins , hsc_hooks = emptyHooks , hsc_tmpfs = tmpfs } @@ -479,7 +478,7 @@ hscParse' mod_summary let applyPluginAction p opts = parsedResultAction p opts mod_summary hsc_env <- getHscEnv - withPlugins hsc_env applyPluginAction res + withPlugins (hsc_plugins hsc_env) applyPluginAction res checkBidirectionFormatChars :: PsLoc -> StringBuffer -> Maybe (NonEmpty (PsLoc, Char, String)) checkBidirectionFormatChars start_loc sb |