Improve warnAboutHlsCompatibility

This commit is contained in:
Julian Ospald 2021-09-14 12:36:14 +02:00
parent c163278c64
commit ae2031174e
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F
2 changed files with 8 additions and 6 deletions

View File

@ -1031,11 +1031,13 @@ warnAboutHlsCompatibility = do
case (currentGHC, currentHLS) of
(Just gv, Just hv) | gv `notElem` supportedGHC -> do
logWarn $ "GHC " <> T.pack (prettyShow gv) <> " is not compatible with "
<> "Haskell Language Server " <> T.pack (prettyShow hv) <> "."
logWarn "Haskell IDE support may not work until this is fixed."
logWarn $ "Install a different HLS version, or run `ghcup list` to see "
<> "supported GHC versions."
logWarn $
"GHC " <> T.pack (prettyShow gv) <> " is not compatible with " <>
"Haskell Language Server " <> T.pack (prettyShow hv) <> "." <> "\n" <>
"Haskell IDE support may not work until this is fixed." <> "\n" <>
"Install a different HLS version, or install and set one of the following GHCs:" <> "\n" <>
T.pack (prettyShow supportedGHC)
_ -> return ()
------------------

View File

@ -475,7 +475,7 @@ hlsGHCVersions = do
. splitOn "~"
)
bins
pure . rights . concat . maybeToList $ vers
pure . sortBy (flip compare) . rights . concat . maybeToList $ vers
-- | Get all server binaries for an hls version, if any.