mirror of
https://github.com/haskell/haskell-ide-engine.git
synced 2024-09-11 11:05:30 +03:00
Sort installed ghcs to fix the lastest target
This commit is contained in:
parent
0e2646bfb8
commit
16be8e7381
@ -17,9 +17,11 @@ import Data.Function ( (&)
|
||||
, on
|
||||
)
|
||||
import Data.List ( sort
|
||||
, sortBy
|
||||
, isInfixOf
|
||||
, nubBy
|
||||
)
|
||||
import Data.Ord ( comparing )
|
||||
import Control.Monad.Extra ( mapMaybeM )
|
||||
import Data.Maybe ( isNothing
|
||||
, mapMaybe
|
||||
@ -61,6 +63,8 @@ findInstalledGhcs = do
|
||||
-- filter out not supported ghc versions
|
||||
availableGhcs <- filter ((`elem` supportedGhcVersions) . fst) <$> getGhcPaths
|
||||
return
|
||||
-- sort by version to make it coherent with getHieVersions
|
||||
$ sortBy (comparing fst)
|
||||
-- nub by version. knownGhcs takes precedence.
|
||||
$ nubBy ((==) `on` fst)
|
||||
-- filter out stack provided GHCs (assuming that stack programs path is the default one in linux)
|
||||
|
Loading…
Reference in New Issue
Block a user