close import.
This commit is contained in:
parent
e0d8b379df
commit
b628175d8f
@ -6,18 +6,18 @@ module Language.Haskell.GhcMod.ErrMsg (
|
|||||||
, handleErrMsg
|
, handleErrMsg
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Bag
|
import Bag (Bag, bagToList)
|
||||||
import Control.Applicative
|
import Control.Applicative ((<$>))
|
||||||
import Data.IORef
|
import Data.IORef (IORef, newIORef, readIORef, writeIORef, modifyIORef)
|
||||||
import Data.Maybe
|
import Data.Maybe (fromMaybe)
|
||||||
import DynFlags
|
import ErrUtils (ErrMsg, errMsgShortDoc, errMsgExtraInfo)
|
||||||
import ErrUtils
|
import GHC (Ghc, DynFlag(Opt_D_dump_splices), DynFlags, SrcSpan, Severity(SevError))
|
||||||
import GHC
|
import qualified GHC as G
|
||||||
import HscTypes
|
import HscTypes (SourceError, srcErrorMessages)
|
||||||
import Language.Haskell.GhcMod.Doc (showUnqualifiedPage)
|
import Language.Haskell.GhcMod.Doc (showUnqualifiedPage)
|
||||||
import Language.Haskell.GhcMod.Types (LineSeparator(..))
|
|
||||||
import qualified Language.Haskell.GhcMod.Gap as Gap
|
import qualified Language.Haskell.GhcMod.Gap as Gap
|
||||||
import Outputable
|
import Language.Haskell.GhcMod.Types (LineSeparator(..))
|
||||||
|
import Outputable (SDoc)
|
||||||
import System.FilePath (normalise)
|
import System.FilePath (normalise)
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
@ -61,7 +61,7 @@ setLogger True df ls = do
|
|||||||
-- | Converting 'SourceError' to 'String'.
|
-- | Converting 'SourceError' to 'String'.
|
||||||
handleErrMsg :: LineSeparator -> SourceError -> Ghc [String]
|
handleErrMsg :: LineSeparator -> SourceError -> Ghc [String]
|
||||||
handleErrMsg ls err = do
|
handleErrMsg ls err = do
|
||||||
dflag <- getSessionDynFlags
|
dflag <- G.getSessionDynFlags
|
||||||
return . errBagToStrList dflag ls . srcErrorMessages $ err
|
return . errBagToStrList dflag ls . srcErrorMessages $ err
|
||||||
|
|
||||||
errBagToStrList :: DynFlags -> LineSeparator -> Bag ErrMsg -> [String]
|
errBagToStrList :: DynFlags -> LineSeparator -> Bag ErrMsg -> [String]
|
||||||
@ -81,7 +81,7 @@ ppMsg spn sev dflag ls msg = prefix ++ cts
|
|||||||
where
|
where
|
||||||
cts = showMsg dflag ls msg
|
cts = showMsg dflag ls msg
|
||||||
defaultPrefix
|
defaultPrefix
|
||||||
| dopt Opt_D_dump_splices dflag = ""
|
| G.dopt Opt_D_dump_splices dflag = ""
|
||||||
| otherwise = "Dummy:0:0:Error:"
|
| otherwise = "Dummy:0:0:Error:"
|
||||||
prefix = fromMaybe defaultPrefix $ do
|
prefix = fromMaybe defaultPrefix $ do
|
||||||
(line,col,_,_) <- Gap.getSrcSpan spn
|
(line,col,_,_) <- Gap.getSrcSpan spn
|
||||||
|
Loading…
Reference in New Issue
Block a user