File tree 5 files changed +16
-5
lines changed
5 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ import GHC hiding (def)
41
41
import qualified GHC.Paths
42
42
43
43
import HIE.Bios
44
+ import HIE.Bios.Ghc.Api (initializeFlagsWithCradle )
44
45
45
46
-- Set the GHC libdir to the nix libdir if it's present.
46
47
getLibdir :: IO FilePath
@@ -76,7 +77,7 @@ main = do
76
77
-- Note that this whole section needs to change once we have genuine
77
78
-- multi environment support. Needs rewriting in terms of loadEnvironment.
78
79
putStrLn " [1/6] Finding hie-bios cradle"
79
- cradle <- findCradle ( dir <> " / " )
80
+ cradle <- getCradle dir
80
81
print cradle
81
82
82
83
putStrLn " \n [2/6] Converting Cradle to GHC session"
@@ -138,5 +139,13 @@ newSession' cradle = getLibdir >>= \libdir -> do
138
139
139
140
loadEnvironment :: FilePath -> IO (FilePath -> Action HscEnvEq )
140
141
loadEnvironment dir = do
141
- res <- liftIO $ newSession' =<< findCradle ( dir <> " / " )
142
+ res <- liftIO $ newSession' =<< getCradle dir
142
143
return $ const $ return res
144
+
145
+ getCradle :: FilePath -> IO Cradle
146
+ getCradle dir = do
147
+ dir <- pure $ addTrailingPathSeparator dir
148
+ mbYaml <- findCradle dir
149
+ case mbYaml of
150
+ Nothing -> loadImplicitCradle dir
151
+ Just yaml -> loadCradle yaml
Original file line number Diff line number Diff line change @@ -40,10 +40,12 @@ import System.IO
40
40
import Foreign.ForeignPtr
41
41
42
42
43
+ #if !MIN_GHC_API_VERSION(8,8,0)
43
44
hPutStringBuffer :: Handle -> StringBuffer -> IO ()
44
45
hPutStringBuffer hdl (StringBuffer buf len cur)
45
46
= withForeignPtr (plusForeignPtr buf cur) $ \ ptr ->
46
47
hPutBuf hdl ptr len
48
+ #endif
47
49
48
50
mkHieFile :: ModSummary -> TcGblEnv -> RenamedSource -> Hsc HieFile
49
51
mkHieFile _ _ _ = return (HieFile () [] )
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ extra-deps:
10
10
- git : https://github.com/bubba/lsp-test.git
11
11
commit : d126623dc6895d325e3d204d74e2a22d4f515587
12
12
- git : https://github.com/mpickering/hie-bios.git
13
- commit : 89e4ba24f87aac9909d9814b0e8c51b679a0ccd4
13
+ commit : 68c662ea1d0e7095ccf2a4e3d393fc524e769bfe
14
14
- ghc-lib-parser-8.8.1
15
15
- ghc-lib-8.8.1
16
16
nix :
Original file line number Diff line number Diff line change @@ -11,6 +11,6 @@ extra-deps:
11
11
- git : https://github.com/bubba/lsp-test.git
12
12
commit : d126623dc6895d325e3d204d74e2a22d4f515587
13
13
- git : https://github.com/mpickering/hie-bios.git
14
- commit : 89e4ba24f87aac9909d9814b0e8c51b679a0ccd4
14
+ commit : 68c662ea1d0e7095ccf2a4e3d393fc524e769bfe
15
15
nix :
16
16
packages : [zlib]
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ extra-deps:
15
15
- git : https://github.com/bubba/lsp-test.git
16
16
commit : d126623dc6895d325e3d204d74e2a22d4f515587
17
17
- git : https://github.com/mpickering/hie-bios.git
18
- commit : 89e4ba24f87aac9909d9814b0e8c51b679a0ccd4
18
+ commit : 68c662ea1d0e7095ccf2a4e3d393fc524e769bfe
19
19
nix :
20
20
packages : [zlib]
21
21
allow-newer : true
You can’t perform that action at this time.
0 commit comments