File tree 8 files changed +42
-2
lines changed
session-loader/Development/IDE
src/Development/IDE/GHC/Compat
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
1115
1115
Nothing -> compRoot
1116
1116
Just wdir -> compRoot </> wdir
1117
1117
let dflags''' =
1118
+ setWorkingDirectory root $
1118
1119
disableWarningsAsErrors $
1119
1120
-- disabled, generated directly by ghcide instead
1120
1121
flip gopt_unset Opt_WriteInterface $
@@ -1125,7 +1126,7 @@ setOptions cfp (ComponentOptions theOpts compRoot _) dflags = do
1125
1126
setBytecodeLinkerOptions $
1126
1127
disableOptimisation $
1127
1128
Compat. setUpTypedHoles $
1128
- makeDynFlagsAbsolute compRoot
1129
+ makeDynFlagsAbsolute root
1129
1130
dflags''
1130
1131
-- initPackages parses the -package flags and
1131
1132
-- 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 (
55
55
setBackend ,
56
56
ghciBackend ,
57
57
Development.IDE.GHC.Compat.Env. platformDefaultBackend ,
58
- workingDirectory
58
+ workingDirectory ,
59
+ setWorkingDirectory ,
59
60
) where
60
61
61
62
import GHC (setInteractiveDynFlags )
@@ -91,6 +92,12 @@ hsc_EPS = Env.hsc_unit_env
91
92
#if !MIN_VERSION_ghc(9,3,0)
92
93
workingDirectory :: a -> Maybe b
93
94
workingDirectory _ = 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 }
94
101
#endif
95
102
96
103
setHomeUnitId_ :: 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