diff options
Diffstat (limited to 'CabalHelper')
-rw-r--r-- | CabalHelper/Main.hs | 8 | ||||
-rw-r--r-- | CabalHelper/Types.hs | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/CabalHelper/Main.hs b/CabalHelper/Main.hs index 077eaab..e704e21 100644 --- a/CabalHelper/Main.hs +++ b/CabalHelper/Main.hs @@ -225,12 +225,12 @@ main = do "package-db-stack":[] -> do let - pkgDbStr GlobalPackageDB = "G" - pkgDbStr UserPackageDB = "U" - pkgDbStr (SpecificPackageDB s) = "S" ++ s + pkgDb GlobalPackageDB = ChPkgGlobal + pkgDb UserPackageDB = ChPkgUser + pkgDb (SpecificPackageDB s) = ChPkgSpecific s -- TODO: Setup.hs has access to the sandbox as well: ghc-mod#478 - return $ Just $ ChResponseList $ map pkgDbStr $ withPackageDB lbi + return $ Just $ ChResponsePkgDbs $ map pkgDb $ withPackageDB lbi "entrypoints":[] -> do eps <- componentsMap lbi v distdir $ \c clbi bi -> diff --git a/CabalHelper/Types.hs b/CabalHelper/Types.hs index 1f7d364..771a83f 100644 --- a/CabalHelper/Types.hs +++ b/CabalHelper/Types.hs @@ -34,6 +34,7 @@ data ChResponse = ChResponseCompList [(ChComponentName, [String])] | ChResponseEntrypoints [(ChComponentName, ChEntrypoint)] | ChResponseList [String] + | ChResponsePkgDbs [ChPkgDb] | ChResponseLbi String | ChResponseVersion String Version deriving (Eq, Ord, Read, Show, Generic) @@ -49,3 +50,8 @@ data ChEntrypoint = ChSetupEntrypoint -- ^ Almost like 'ChExeEntrypoint' but | ChExeEntrypoint { chMainIs :: FilePath , chOtherModules :: [ChModuleName] } deriving (Eq, Ord, Read, Show, Generic) + +data ChPkgDb = ChPkgGlobal + | ChPkgUser + | ChPkgSpecific FilePath + deriving (Eq, Ord, Read, Show, Generic) |