From 055d159a039f7a1c4b159a099bbf691d5cd64c81 Mon Sep 17 00:00:00 2001 From: Daniel Gorin Date: Wed, 22 Jul 2015 16:57:51 +0100 Subject: [PATCH] Pass the ide-backend-tools-path arg to stack-ide stack-ide is called with --ide-backend-tools-path=:, where - is the bin directory of the local db - is the bin directory of the snapshot db This way, by somehow depending on ide-backend-server on every project, one can ensure that a suitably linked server will be found for it (even in a setting with multiple instances of ghc, etc). --- src/Stack/Ide.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Stack/Ide.hs b/src/Stack/Ide.hs index a0d208d5ef..a865eb8a88 100644 --- a/src/Stack/Ide.hs +++ b/src/Stack/Ide.hs @@ -108,14 +108,19 @@ ide targets useropts = do else return Nothing localdb <- packageDatabaseLocal depsdb <- packageDatabaseDeps + 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) + ] exec "stack-ide" (["--local-work-dir=" ++ toFilePath pwd] ++ map ("--ghc-option=" ++) (filter (not . badForGhci) useropts) <> + paths <> pkgopts <> pkgdbs) (encode (initialRequest srcfiles))