From ae2031174ef6a62adec1c85602ce7e179ed0f583 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 14 Sep 2021 12:36:14 +0200 Subject: [PATCH] Improve warnAboutHlsCompatibility --- lib/GHCup.hs | 12 +++++++----- lib/GHCup/Utils.hs | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/GHCup.hs b/lib/GHCup.hs index a383d2c..71e0cb6 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -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 () ------------------ diff --git a/lib/GHCup/Utils.hs b/lib/GHCup/Utils.hs index ad21d46..4da2e27 100644 --- a/lib/GHCup/Utils.hs +++ b/lib/GHCup/Utils.hs @@ -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.