From 80ddf63691b87058d184f9e4aaf081114d4bfb4c Mon Sep 17 00:00:00 2001 From: Jurijs Oniscuks Date: Sun, 4 Dec 2016 01:08:06 +0100 Subject: [PATCH] Fix for "ghc-mod doc Data.Maybe" when used with stack projects When ghc-pkg is invoked from a stack project the global database is indeed used: $ stack exec -- ghc-pkg find-module Data.Maybe /var/lib/ghc/package.conf.d base-4.9.0.0 /home/user/.stack/snapshots/x86_64-linux/lts-7.11/8.0.1/pkgdb (no packages) /home/user/work/ghc-mod-5.6.0.0/.stack-work/install/x86_64-linux/lts-7.11/8.0.1/pkgdb (no packages) Therefore "ghc-mod doc" should also use GlobalDb --- Language/Haskell/GhcMod/GhcPkg.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Language/Haskell/GhcMod/GhcPkg.hs b/Language/Haskell/GhcMod/GhcPkg.hs index db2581d..86ab83b 100644 --- a/Language/Haskell/GhcMod/GhcPkg.hs +++ b/Language/Haskell/GhcMod/GhcPkg.hs @@ -86,7 +86,7 @@ getPackageDbStack = do CabalProject -> getCabalPackageDbStack (StackProject StackEnv {..}) -> - return $ map PackageDb [seSnapshotPkgDb, seLocalPkgDb] + return $ [GlobalDb, PackageDb seSnapshotPkgDb, PackageDb seLocalPkgDb] return $ fromMaybe stack mCusPkgStack getPackageCachePaths :: IOish m => FilePath -> GhcModT m [FilePath]