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
|
cts = showMsg dflag ls msg
|
||||||
defaultPrefix
|
defaultPrefix
|
||||||
| dopt Opt_D_dump_splices dflag = ""
|
| dopt Opt_D_dump_splices dflag = ""
|
||||||
| otherwise = "Dummy:0:0:"
|
| otherwise = "Dummy:0:0:Error:"
|
||||||
prefix = fromMaybe defaultPrefix $ do
|
prefix = fromMaybe defaultPrefix $ do
|
||||||
(line,col,_,_) <- Gap.getSrcSpan spn
|
(line,col,_,_) <- Gap.getSrcSpan spn
|
||||||
file <- normalise <$> Gap.getSrcFile spn
|
file <- normalise <$> Gap.getSrcFile spn
|
||||||
|
@ -6,6 +6,7 @@ module Language.Haskell.GhcMod.GHCApi (
|
|||||||
, initializeFlags
|
, initializeFlags
|
||||||
, initializeFlagsWithCradle
|
, initializeFlagsWithCradle
|
||||||
, setTargetFiles
|
, setTargetFiles
|
||||||
|
, addTargetFiles
|
||||||
, getDynamicFlags
|
, getDynamicFlags
|
||||||
) where
|
) where
|
||||||
|
|
||||||
@ -157,6 +158,12 @@ setTargetFiles files = do
|
|||||||
targets <- forM files $ \file -> guessTarget file Nothing
|
targets <- forM files $ \file -> guessTarget file Nothing
|
||||||
setTargets targets
|
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.
|
-- | Return the 'DynFlags' currently in use in the GHC session.
|
||||||
|
@ -21,6 +21,8 @@ module Language.Haskell.GhcMod.Internal (
|
|||||||
, initializeFlagsWithCradle
|
, initializeFlagsWithCradle
|
||||||
-- * 'GhcMonad'
|
-- * 'GhcMonad'
|
||||||
, setTargetFiles
|
, setTargetFiles
|
||||||
|
, addTargetFiles
|
||||||
|
, handleErrMsg
|
||||||
-- * 'Ghc' Choice
|
-- * 'Ghc' Choice
|
||||||
, (||>)
|
, (||>)
|
||||||
, goNext
|
, goNext
|
||||||
|
Loading…
Reference in New Issue
Block a user