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

View File

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