diff --git a/Language/Haskell/GhcMod/GHCApi.hs b/Language/Haskell/GhcMod/GHCApi.hs index 2cd0886..ba98bfe 100644 --- a/Language/Haskell/GhcMod/GHCApi.hs +++ b/Language/Haskell/GhcMod/GHCApi.hs @@ -1,9 +1,7 @@ {-# LANGUAGE ScopedTypeVariables, RecordWildCards #-} module Language.Haskell.GhcMod.GHCApi ( - withGHC - , withGHC' - , initializeFlagsWithCradle + initializeFlagsWithCradle , setTargetFiles , getDynamicFlags , systemLibDir @@ -39,26 +37,6 @@ systemLibDir = libdir ---------------------------------------------------------------- --- | Converting the 'Ghc' monad to the 'IO' monad. -withGHC :: FilePath -- ^ A target file displayed in an error message. - -> Ghc a -- ^ 'Ghc' actions created by the Ghc utilities. - -> IO a -withGHC file body = ghandle ignore $ withGHC' body - where - ignore :: SomeException -> IO a - ignore e = do - hPutStr stderr $ file ++ ":0:0:Error:" - hPrint stderr e - exitSuccess - -withGHC' :: Ghc a -> IO a -withGHC' body = do - G.runGhc (Just systemLibDir) $ do - dflags <- G.getSessionDynFlags - G.defaultCleanupHandler dflags body - ----------------------------------------------------------------- - importDirs :: [IncludeDir] importDirs = [".","..","../..","../../..","../../../..","../../../../.."] @@ -107,6 +85,7 @@ initSession build Options {..} CompilerOptions {..} = do $ setEmptyLogger $ Gap.addPackageFlags depPackages df) + setEmptyLogger :: DynFlags -> DynFlags setEmptyLogger df = Gap.setLogAction df $ \_ _ _ _ _ -> return () diff --git a/Language/Haskell/GhcMod/Ghc.hs b/Language/Haskell/GhcMod/Ghc.hs index b2259db..0d2cd20 100644 --- a/Language/Haskell/GhcMod/Ghc.hs +++ b/Language/Haskell/GhcMod/Ghc.hs @@ -1,9 +1,6 @@ module Language.Haskell.GhcMod.Ghc ( - -- * Converting the 'Ghc' monad to the 'IO' monad - withGHC - , withGHC' -- * 'SymMdlDb' - , Symbol + Symbol , SymMdlDb , getSymMdlDb , lookupSym