Add mapped files to World
This commit is contained in:
parent
89bc149f60
commit
4241ef16b2
@ -71,7 +71,7 @@ data OutputStyle = LispStyle -- ^ S expression style.
|
|||||||
newtype LineSeparator = LineSeparator String deriving (Show)
|
newtype LineSeparator = LineSeparator String deriving (Show)
|
||||||
|
|
||||||
data FileMapping = FileMapping {fmPath :: FilePath, fmTemp :: Bool}
|
data FileMapping = FileMapping {fmPath :: FilePath, fmTemp :: Bool}
|
||||||
deriving Show
|
deriving (Eq, Show)
|
||||||
|
|
||||||
type FileMappingMap = Map FilePath FileMapping
|
type FileMappingMap = Map FilePath FileMapping
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ data World = World {
|
|||||||
, worldCabalFile :: Maybe TimedFile
|
, worldCabalFile :: Maybe TimedFile
|
||||||
, worldCabalConfig :: Maybe TimedFile
|
, worldCabalConfig :: Maybe TimedFile
|
||||||
, worldCabalSandboxConfig :: Maybe TimedFile
|
, worldCabalSandboxConfig :: Maybe TimedFile
|
||||||
|
, worldMappedFiles :: FileMappingMap
|
||||||
} deriving (Eq)
|
} deriving (Eq)
|
||||||
|
|
||||||
timedPackageCaches :: IOish m => GhcModT m [TimedFile]
|
timedPackageCaches :: IOish m => GhcModT m [TimedFile]
|
||||||
@ -34,12 +35,14 @@ getCurrentWorld = do
|
|||||||
mCabalFile <- liftIO $ timeFile `traverse` cradleCabalFile crdl
|
mCabalFile <- liftIO $ timeFile `traverse` cradleCabalFile crdl
|
||||||
mCabalConfig <- liftIO $ timeMaybe (setupConfigFile crdl)
|
mCabalConfig <- liftIO $ timeMaybe (setupConfigFile crdl)
|
||||||
mCabalSandboxConfig <- liftIO $ timeMaybe (sandboxConfigFile crdl)
|
mCabalSandboxConfig <- liftIO $ timeMaybe (sandboxConfigFile crdl)
|
||||||
|
mFileMap <- getMMappedFiles
|
||||||
|
|
||||||
return World {
|
return World {
|
||||||
worldPackageCaches = pkgCaches
|
worldPackageCaches = pkgCaches
|
||||||
, worldCabalFile = mCabalFile
|
, worldCabalFile = mCabalFile
|
||||||
, worldCabalConfig = mCabalConfig
|
, worldCabalConfig = mCabalConfig
|
||||||
, worldCabalSandboxConfig = mCabalSandboxConfig
|
, worldCabalSandboxConfig = mCabalSandboxConfig
|
||||||
|
, worldMappedFiles = mFileMap
|
||||||
}
|
}
|
||||||
|
|
||||||
didWorldChange :: IOish m => World -> GhcModT m Bool
|
didWorldChange :: IOish m => World -> GhcModT m Bool
|
||||||
|
Loading…
Reference in New Issue
Block a user