mirror of
https://github.com/haskell/ghcide.git
synced 2024-09-11 13:57:06 +03:00
Build on GHC 8.8 (#43)
This commit is contained in:
parent
7133f4192f
commit
9a5ee23c01
13
exe/Main.hs
13
exe/Main.hs
@ -41,6 +41,7 @@ import GHC hiding (def)
|
||||
import qualified GHC.Paths
|
||||
|
||||
import HIE.Bios
|
||||
import HIE.Bios.Ghc.Api (initializeFlagsWithCradle)
|
||||
|
||||
-- Set the GHC libdir to the nix libdir if it's present.
|
||||
getLibdir :: IO FilePath
|
||||
@ -76,7 +77,7 @@ main = do
|
||||
-- Note that this whole section needs to change once we have genuine
|
||||
-- multi environment support. Needs rewriting in terms of loadEnvironment.
|
||||
putStrLn "[1/6] Finding hie-bios cradle"
|
||||
cradle <- findCradle (dir <> "/")
|
||||
cradle <- getCradle dir
|
||||
print cradle
|
||||
|
||||
putStrLn "\n[2/6] Converting Cradle to GHC session"
|
||||
@ -138,5 +139,13 @@ newSession' cradle = getLibdir >>= \libdir -> do
|
||||
|
||||
loadEnvironment :: FilePath -> IO (FilePath -> Action HscEnvEq)
|
||||
loadEnvironment dir = do
|
||||
res <- liftIO $ newSession' =<< findCradle (dir <> "/")
|
||||
res <- liftIO $ newSession' =<< getCradle dir
|
||||
return $ const $ return res
|
||||
|
||||
getCradle :: FilePath -> IO Cradle
|
||||
getCradle dir = do
|
||||
dir <- pure $ addTrailingPathSeparator dir
|
||||
mbYaml <- findCradle dir
|
||||
case mbYaml of
|
||||
Nothing -> loadImplicitCradle dir
|
||||
Just yaml -> loadCradle yaml
|
||||
|
@ -40,10 +40,12 @@ import System.IO
|
||||
import Foreign.ForeignPtr
|
||||
|
||||
|
||||
#if !MIN_GHC_API_VERSION(8,8,0)
|
||||
hPutStringBuffer :: Handle -> StringBuffer -> IO ()
|
||||
hPutStringBuffer hdl (StringBuffer buf len cur)
|
||||
= withForeignPtr (plusForeignPtr buf cur) $ \ptr ->
|
||||
hPutBuf hdl ptr len
|
||||
#endif
|
||||
|
||||
mkHieFile :: ModSummary -> TcGblEnv -> RenamedSource -> Hsc HieFile
|
||||
mkHieFile _ _ _ = return (HieFile () [])
|
||||
|
@ -10,7 +10,7 @@ extra-deps:
|
||||
- git: https://github.com/bubba/lsp-test.git
|
||||
commit: d126623dc6895d325e3d204d74e2a22d4f515587
|
||||
- git: https://github.com/mpickering/hie-bios.git
|
||||
commit: 89e4ba24f87aac9909d9814b0e8c51b679a0ccd4
|
||||
commit: 68c662ea1d0e7095ccf2a4e3d393fc524e769bfe
|
||||
- ghc-lib-parser-8.8.1
|
||||
- ghc-lib-8.8.1
|
||||
nix:
|
||||
|
@ -11,6 +11,6 @@ extra-deps:
|
||||
- git: https://github.com/bubba/lsp-test.git
|
||||
commit: d126623dc6895d325e3d204d74e2a22d4f515587
|
||||
- git: https://github.com/mpickering/hie-bios.git
|
||||
commit: 89e4ba24f87aac9909d9814b0e8c51b679a0ccd4
|
||||
commit: 68c662ea1d0e7095ccf2a4e3d393fc524e769bfe
|
||||
nix:
|
||||
packages: [zlib]
|
||||
|
@ -15,7 +15,7 @@ extra-deps:
|
||||
- git: https://github.com/bubba/lsp-test.git
|
||||
commit: d126623dc6895d325e3d204d74e2a22d4f515587
|
||||
- git: https://github.com/mpickering/hie-bios.git
|
||||
commit: 89e4ba24f87aac9909d9814b0e8c51b679a0ccd4
|
||||
commit: 68c662ea1d0e7095ccf2a4e3d393fc524e769bfe
|
||||
nix:
|
||||
packages: [zlib]
|
||||
allow-newer: true
|
||||
|
Loading…
Reference in New Issue
Block a user