Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import DynFlags (gopt_set, gopt_unset,
updOptLevel)
import DynFlags (PackageFlag(..), PackageArg(..))
import GHC hiding (def)
import GHC.Check ( VersionCheck(..), makeGhcVersionChecker )
import GHC.Check (GhcVersionChecker, InstallationCheck(..), makeGhcVersionChecker)
-- import GhcMonad
import HIE.Bios.Cradle
import HIE.Bios.Environment (addCmdOpts, makeDynFlagsAbsolute)
Expand Down Expand Up @@ -664,17 +664,18 @@ getCacheDir prefix opts = IO.getXdgDirectory IO.XdgCache (cacheDir </> prefix ++
cacheDir :: String
cacheDir = "ghcide"

ghcVersionChecker :: IO VersionCheck
ghcVersionChecker = $$(makeGhcVersionChecker (pure <$> getLibdir))
ghcVersionChecker :: GhcVersionChecker
ghcVersionChecker = $$(makeGhcVersionChecker getLibdir)

checkGhcVersion :: IO (Maybe HscEnvEq)
checkGhcVersion = do
res <- ghcVersionChecker
runtimeLibdir <- getLibdir
res <- ghcVersionChecker runtimeLibdir
case res of
Failure err -> do
putStrLn $ "Error while checking GHC version: " ++ show err
InstallationNotFound libdir -> do
putStrLn $ "Error not found GHC while checking GHC version: " ++ libdir
return Nothing
Mismatch {..} ->
InstallationMismatch {..} ->
return $ Just GhcVersionMismatch {..}
_ ->
InstallationChecked {} ->
return Nothing
2 changes: 1 addition & 1 deletion haskell-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ executable haskell-language-server
-- which works for now.
, ghc
--------------------------------------------------------------
, ghc-check >= 0.3.0.1 && < 0.4
, ghc-check >= 0.4
, ghc-paths
, ghcide
, gitrev
Expand Down