Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Plugin Compat utils.
Synopsis
- data Plugin = Plugin {
- installCoreToDos :: CorePlugin
- tcPlugin :: TcPlugin
- holeFitPlugin :: HoleFitPlugin
- driverPlugin :: [CommandLineOption] -> HscEnv -> IO HscEnv
- pluginRecompile :: [CommandLineOption] -> IO PluginRecompile
- parsedResultAction :: [CommandLineOption] -> ModSummary -> HsParsedModule -> Hsc HsParsedModule
- renamedResultAction :: [CommandLineOption] -> TcGblEnv -> HsGroup GhcRn -> TcM (TcGblEnv, HsGroup GhcRn)
- typeCheckResultAction :: [CommandLineOption] -> ModSummary -> TcGblEnv -> TcM TcGblEnv
- spliceRunAction :: [CommandLineOption] -> LHsExpr GhcTc -> TcM (LHsExpr GhcTc)
- interfaceLoadAction :: forall lcl. [CommandLineOption] -> ModIface -> IfM lcl ModIface
- defaultPlugin :: Plugin
- data PluginWithArgs = PluginWithArgs {}
- applyPluginsParsedResultAction :: HscEnv -> DynFlags -> ModSummary -> ApiAnns -> ParsedSource -> PsMessages -> IO (ParsedSource, PsMessages)
- initializePlugins :: HscEnv -> IO HscEnv
- initPlugins :: HscEnv -> ModSummary -> IO (ModSummary, HscEnv)
- data StaticPlugin = StaticPlugin {}
- hsc_static_plugins :: HscEnv -> [StaticPlugin]
- type PsMessages = (Bag WarnMsg, Bag ErrMsg)
- getPsMessages :: PState -> DynFlags -> PsMessages
Plugin Compat Types, and initialisation
Plugin
is the compiler plugin data type. Try to avoid
constructing one of these directly, and just modify some fields of
defaultPlugin
instead: this is to try and preserve source-code
compatibility when we add fields to this.
Nonetheless, this API is preliminary and highly likely to change in the future.
Plugin | |
|
defaultPlugin :: Plugin #
Default plugin: does nothing at all, except for marking that safe
inference has failed unless -fplugin-trustworthy
is passed. For
compatibility reason you should base all your plugin definitions on this
default value.
data PluginWithArgs #
PluginWithArgs | |
|
applyPluginsParsedResultAction :: HscEnv -> DynFlags -> ModSummary -> ApiAnns -> ParsedSource -> PsMessages -> IO (ParsedSource, PsMessages) Source #
initPlugins :: HscEnv -> ModSummary -> IO (ModSummary, HscEnv) Source #
Plugins aren't stored in ModSummary anymore since GHC 9.2, but this function still returns it for compatibility with 8.10
Static plugins
data StaticPlugin #
A static plugin with its arguments. For registering compiled-in plugins through the GHC API.
StaticPlugin | |
|
hsc_static_plugins :: HscEnv -> [StaticPlugin] Source #
Plugin messages
getPsMessages :: PState -> DynFlags -> PsMessages Source #