File tree Expand file tree Collapse file tree 8 files changed +42
-2
lines changed
session-loader/Development/IDE
src/Development/IDE/GHC/Compat Expand file tree Collapse file tree 8 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -1115,6 +1115,7 @@ setOptions cfp (ComponentOptions theOpts compRoot _) dflags = do
11151115 Nothing -> compRoot
11161116 Just wdir -> compRoot </> wdir
11171117 let dflags''' =
1118+ setWorkingDirectory root $
11181119 disableWarningsAsErrors $
11191120 -- disabled, generated directly by ghcide instead
11201121 flip gopt_unset Opt_WriteInterface $
@@ -1125,7 +1126,7 @@ setOptions cfp (ComponentOptions theOpts compRoot _) dflags = do
11251126 setBytecodeLinkerOptions $
11261127 disableOptimisation $
11271128 Compat. setUpTypedHoles $
1128- makeDynFlagsAbsolute compRoot
1129+ makeDynFlagsAbsolute root
11291130 dflags''
11301131 -- initPackages parses the -package flags and
11311132 -- sets up the visibility for each component.
Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ module Development.IDE.GHC.Compat.Env (
5555 setBackend ,
5656 ghciBackend ,
5757 Development.IDE.GHC.Compat.Env. platformDefaultBackend ,
58- workingDirectory
58+ workingDirectory ,
59+ setWorkingDirectory ,
5960 ) where
6061
6162import GHC (setInteractiveDynFlags )
@@ -91,6 +92,12 @@ hsc_EPS = Env.hsc_unit_env
9192#if !MIN_VERSION_ghc(9,3,0)
9293workingDirectory :: a -> Maybe b
9394workingDirectory _ = Nothing
95+
96+ setWorkingDirectory :: FilePath -> DynFlags -> DynFlags
97+ setWorkingDirectory = const id
98+ #else
99+ setWorkingDirectory :: FilePath -> DynFlags -> DynFlags
100+ setWorkingDirectory p d = d { workingDirectory = Just p }
94101#endif
95102
96103setHomeUnitId_ :: UnitId -> DynFlags -> DynFlags
Original file line number Diff line number Diff line change 1+ {-# LANGUAGE TemplateHaskell #-}
2+ module A (th_a ) where
3+
4+ import Language.Haskell.TH
5+ import Language.Haskell.TH.Syntax
6+ import Control.Monad.IO.Class
7+
8+ th_a :: DecsQ
9+ th_a = do
10+ str <- makeRelativeToProject " wdtest" >>= liftIO . readFile
11+ [d | a = $(lift str) |]
Original file line number Diff line number Diff line change 1+ {-# LANGUAGE TemplateHaskell #-}
2+ module B () where
3+
4+ import A
5+
6+ $ th_a
Original file line number Diff line number Diff line change 1+ name : a
2+ version : 1.0.0
3+ build-type : Simple
4+ cabal-version : >= 1.2
5+ extra-source-files : wdtest
6+
7+ library
8+ build-depends : base, template-haskell
9+ exposed-modules : A B
10+ ghc-options : -Wmissing-signatures
11+ hs-source-dirs : .
Original file line number Diff line number Diff line change 1+ test
Original file line number Diff line number Diff line change 1+ packages : a
Original file line number Diff line number Diff line change 1+ cradle :
2+ cabal :
You can’t perform that action at this time.
0 commit comments