From 473f1e09c77ee3bb1ca25e7741994b0f33a9106e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 21 Aug 2015 04:12:53 +0200 Subject: [PATCH] Rename withContext -> withInteractiveContext --- Language/Haskell/GhcMod/Gap.hs | 6 +++--- Language/Haskell/GhcMod/Info.hs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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