diff --git a/Language/Haskell/GhcMod/Gap.hs b/Language/Haskell/GhcMod/Gap.hs index 198c3a4..cbf773b 100644 --- a/Language/Haskell/GhcMod/Gap.hs +++ b/Language/Haskell/GhcMod/Gap.hs @@ -7,7 +7,7 @@ module Language.Haskell.GhcMod.Gap ( , setLogAction , getSrcSpan , getSrcFile - , withContext + , withInteractiveContext , fOptions , toStringBuffer , showSeverityCaption @@ -214,8 +214,8 @@ fileModSummary file' = do (Just file==) <$> canonicalizePath `traverse` ml_hs_file (ms_location m) return ms -withContext :: GhcMonad m => m a -> m a -withContext action = gbracket setup teardown body +withInteractiveContext :: GhcMonad m => m a -> m a +withInteractiveContext action = gbracket setup teardown body where setup = getContext teardown = setCtx diff --git a/Language/Haskell/GhcMod/Info.hs b/Language/Haskell/GhcMod/Info.hs index f22451d..e952838 100644 --- a/Language/Haskell/GhcMod/Info.hs +++ b/Language/Haskell/GhcMod/Info.hs @@ -35,7 +35,7 @@ info :: IOish m info file expr = ghandle handler $ runGmlT' [Left file] deferErrors $ - withContext $ + withInteractiveContext $ convert <$> options <*> body where handler (SomeException ex) = do @@ -61,7 +61,7 @@ types :: IOish m types file lineNo colNo = ghandle handler $ runGmlT' [Left file] deferErrors $ - withContext $ do + withInteractiveContext $ do crdl <- cradle modSum <- fileModSummaryWithMapping (cradleCurrentDir crdl file) srcSpanTypes <- getSrcSpanType modSum lineNo colNo