diff --git a/src/Stack/Ide.hs b/src/Stack/Ide.hs index a865eb8a88..4bf5707ec7 100644 --- a/src/Stack/Ide.hs +++ b/src/Stack/Ide.hs @@ -32,6 +32,7 @@ import Stack.Exec (defaultEnvSettings) import Stack.Package import Stack.Types import System.Directory (doesFileExist) +import System.Environment (lookupEnv) import System.Exit import System.IO import qualified System.Process as P @@ -108,13 +109,14 @@ ide targets useropts = do else return Nothing localdb <- packageDatabaseLocal depsdb <- packageDatabaseDeps + mpath <- liftIO $ lookupEnv "PATH" bindirs <- extraBinDirs `ap` return True {- include local bin -} let pkgopts = concat (map _2 pkgs) srcfiles = concatMap (map toFilePath . _3) pkgs pkgdbs = ["--package-db=" <> toFilePath depsdb <> ":" <> toFilePath localdb] paths = - ["--ide-backend-tools-path=" <> intercalate ":" (map toFilePath bindirs) + ["--ide-backend-tools-path=" <> intercalate ":" (map toFilePath bindirs) <> (maybe "" (':':) mpath) ] exec "stack-ide"