Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit b39f46f

Browse files
authored
Merge pull request #887 from expipiplus1/joe
Allow setting an explicit hoogle database location
2 parents 667cc71 + 9becc5e commit b39f46f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Haskell/Ide/Engine/Plugin/Hoogle.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Haskell.Ide.Engine.MonadTypes
1515
import Haskell.Ide.Engine.MonadFunctions
1616
import Hoogle
1717
import System.Directory
18+
import System.Environment
1819
import Text.HTML.TagSoup
1920
import Text.HTML.TagSoup.Tree
2021

@@ -55,7 +56,8 @@ instance ExtensionClass HoogleDb where
5556

5657
initializeHoogleDb :: IdeGhcM (Maybe FilePath)
5758
initializeHoogleDb = do
58-
db' <- liftIO $ defaultDatabaseLocation
59+
explicitDbLocation <- liftIO $ lookupEnv "HIE_HOOGLE_DATABASE"
60+
db' <- maybe (liftIO defaultDatabaseLocation) pure explicitDbLocation
5961
db <- liftIO $ makeAbsolute db'
6062
exists <- liftIO $ doesFileExist db
6163
if exists then do

0 commit comments

Comments
 (0)