Add version numbers to error message.

Fixes after formatting changes.
This commit is contained in:
Chris Smith 2021-09-11 23:17:14 -04:00
parent bc64d2ade0
commit 972474f79a

View File

@ -868,8 +868,6 @@ setGHC ver sghc = do
-- create symlink for share dir -- create symlink for share dir
when (isNothing . _tvTarget $ ver) $ lift $ symlinkShareDir ghcdir verS when (isNothing . _tvTarget $ ver) $ lift $ symlinkShareDir ghcdir verS
case sghc of
SetGHCOnly -> lift warnAboutHlsCompatibility
when (sghc == SetGHCOnly) $ lift warnAboutHlsCompatibility when (sghc == SetGHCOnly) $ lift warnAboutHlsCompatibility
pure ver pure ver
@ -1016,8 +1014,8 @@ setStack ver = do
pure () pure ()
-- | Warn if the installed and set HLS is not compatible -- | Warn if the installed and set HLS is not compatible with the installed and
-- with the installed and set GHC version. -- set GHC version.
warnAboutHlsCompatibility :: ( MonadReader env m warnAboutHlsCompatibility :: ( MonadReader env m
, HasDirs env , HasDirs env
, HasLog env , HasLog env
@ -1029,12 +1027,12 @@ warnAboutHlsCompatibility :: ( MonadReader env m
warnAboutHlsCompatibility = do warnAboutHlsCompatibility = do
supportedGHC <- hlsGHCVersions supportedGHC <- hlsGHCVersions
currentGHC <- fmap _tvVersion <$> ghcSet Nothing currentGHC <- fmap _tvVersion <$> ghcSet Nothing
currentHLS <- hlsSet
case currentGHC of case (currentGHC, currentHLS) of
Just v | not (null supportedGHC) (Just gv, Just hv) | gv `notElem` supportedGHC -> do
, v `notElem` supportedGHC -> do logWarn $ "GHC " <> T.pack (prettyShow gv) <> " is not compatible with "
logWarn $ "The current GHC version is not compatible with the " <> "Haskell Language Server " <> T.pack (prettyShow hv) <> "."
<> "current version of Haskell Language Server."
logWarn $ "Haskell IDE support may not work correctly until this is " logWarn $ "Haskell IDE support may not work correctly until this is "
<> "fixed." <> "fixed."
logWarn $ "Install a different HLS version, or run `ghcup list` to see " logWarn $ "Install a different HLS version, or run `ghcup list` to see "