new APIs.

This commit is contained in:
Kazu Yamamoto 2014-03-19 10:23:32 +09:00
parent 710ac6636e
commit be926f0366
3 changed files with 10 additions and 1 deletions

View File

@ -81,7 +81,7 @@ ppMsg spn sev dflag ls@(LineSeparator lsep) msg = prefix ++ cts ++ lsep
cts = showMsg dflag ls msg
defaultPrefix
| dopt Opt_D_dump_splices dflag = ""
| otherwise = "Dummy:0:0:"
| otherwise = "Dummy:0:0:Error:"
prefix = fromMaybe defaultPrefix $ do
(line,col,_,_) <- Gap.getSrcSpan spn
file <- normalise <$> Gap.getSrcFile spn

View File

@ -6,6 +6,7 @@ module Language.Haskell.GhcMod.GHCApi (
, initializeFlags
, initializeFlagsWithCradle
, setTargetFiles
, addTargetFiles
, getDynamicFlags
) where
@ -157,6 +158,12 @@ setTargetFiles files = do
targets <- forM files $ \file -> guessTarget file Nothing
setTargets targets
addTargetFiles :: (GhcMonad m) => [FilePath] -> m ()
addTargetFiles [] = error "ghc-mod: addTargetFiles: No target files given"
addTargetFiles files = do
targets <- forM files $ \file -> guessTarget file Nothing
mapM_ addTarget targets
----------------------------------------------------------------
-- | Return the 'DynFlags' currently in use in the GHC session.

View File

@ -21,6 +21,8 @@ module Language.Haskell.GhcMod.Internal (
, initializeFlagsWithCradle
-- * 'GhcMonad'
, setTargetFiles
, addTargetFiles
, handleErrMsg
-- * 'Ghc' Choice
, (||>)
, goNext