From 756d17eaa2f3ba0a1ecd9020f763256e2949aa6a Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Mon, 21 Apr 2014 09:45:41 +0900 Subject: [PATCH] -l for ghc-modi info. --- Language/Haskell/GhcMod/Info.hs | 9 +++++---- src/GHCModi.hs | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Language/Haskell/GhcMod/Info.hs b/Language/Haskell/GhcMod/Info.hs index d26ecc9..825d1ae 100644 --- a/Language/Haskell/GhcMod/Info.hs +++ b/Language/Haskell/GhcMod/Info.hs @@ -38,17 +38,18 @@ infoExpr :: Options -> Expression -- ^ A Haskell expression. -> IO String infoExpr opt cradle file expr = (++ "\n") <$> withGHCDummyFile - (inModuleContext opt cradle file (info file expr) "Cannot show info") + (inModuleContext opt cradle file (info opt file expr) "Cannot show info") -- | Obtaining information of a target expression. (GHCi's info:) -info :: FilePath -- ^ A target file. +info :: Options + -> FilePath -- ^ A target file. -> Expression -- ^ A Haskell expression. -> Ghc String -info file expr = do +info opt file expr = do void $ Gap.setCtx file sdoc <- Gap.infoThing expr (dflag, style) <- getFlagStyle - return $ showPage dflag style sdoc + return $ convert opt $ showPage dflag style sdoc ---------------------------------------------------------------- diff --git a/src/GHCModi.hs b/src/GHCModi.hs index cc590ac..c0492fc 100644 --- a/src/GHCModi.hs +++ b/src/GHCModi.hs @@ -256,9 +256,9 @@ showInfo :: Options showInfo opt set ls readLog fileArg = do let [file, expr] = words fileArg (_, _, set') <- checkStx opt set ls readLog file - msgs <- info file expr -- fixme + ret <- info opt file expr _ <- liftIO readLog - return (msgs, True, set') -- fixme + return (ret, True, set') showType :: Options -> Set FilePath