getConfig runs "cabal configure" first if setup-config is invalid.

This commit is contained in:
Kazu Yamamoto
2014-09-23 21:28:03 +09:00
parent 7db266c22d
commit c4929c54af
7 changed files with 91 additions and 109 deletions

View File

@@ -48,34 +48,21 @@ module Language.Haskell.GhcMod.Internal (
, runAnyOne
-- * World
, World
, getWorld
, isChanged
, getCurrentWorld
, isWorldChanged
) where
import GHC.Paths (libdir)
import GHC (getSessionDynFlags)
import Language.Haskell.GhcMod.CabalApi
import Language.Haskell.GhcMod.CabalConfig
import Language.Haskell.GhcMod.DynFlags
import Language.Haskell.GhcMod.GHCChoice
import Language.Haskell.GhcMod.Logger
import Language.Haskell.GhcMod.Monad
import Language.Haskell.GhcMod.Target
import Language.Haskell.GhcMod.Types
import Language.Haskell.GhcMod.World
-- | Obtaining the directory for ghc system libraries.
ghcLibDir :: FilePath
ghcLibDir = libdir
getWorld :: IOish m => GhcModT m World
getWorld = do
crdl <- cradle
dflags <- getSessionDynFlags
liftIO $ getCurrentWorld crdl dflags
isChanged :: IOish m => World -> GhcModT m Bool
isChanged world = do
crdl <- cradle
dflags <- getSessionDynFlags
liftIO $ isWorldChanged world crdl dflags