new APIs.
This commit is contained in:
parent
710ac6636e
commit
be926f0366
@ -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
|
||||
|
@ -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.
|
||||
|
@ -21,6 +21,8 @@ module Language.Haskell.GhcMod.Internal (
|
||||
, initializeFlagsWithCradle
|
||||
-- * 'GhcMonad'
|
||||
, setTargetFiles
|
||||
, addTargetFiles
|
||||
, handleErrMsg
|
||||
-- * 'Ghc' Choice
|
||||
, (||>)
|
||||
, goNext
|
||||
|
Loading…
Reference in New Issue
Block a user