@@ -21,7 +21,7 @@ import Control.Monad
21import Control.Monad.Trans.Class
21import Control.Monad.Trans.Class
22import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
22import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
24−import Data.List (nub, isPrefixOf)
24+import Data.List (nub, isPrefixOf, sort)
25import Data.Maybe (mapMaybe)
25import Data.Maybe (mapMaybe)
26import Data.Traversable (traverse)
26import Data.Traversable (traverse)
@@ -61,7 +61,7 @@ completion ms = completeWord Nothing " \t\n\r" findCompletions
61 , qual <- [ P.Qualified Nothing ident
61 , qual <- [ P.Qualified Nothing ident
62 , P.Qualified (Just moduleName) ident]
62 , P.Qualified (Just moduleName) ident]
64− let matches = filter (isPrefixOf str) names
64+ let matches = sort $ filter (isPrefixOf str) names
65 return $ map simpleCompletion matches ++ files
65 return $ map simpleCompletion matches ++ files
66 getDeclName :: P.Declaration -> Maybe P.Ident
66 getDeclName :: P.Declaration -> Maybe P.Ident
67 getDeclName (P.ValueDeclaration ident _ _ _) = Just ident
67 getDeclName (P.ValueDeclaration ident _ _ _) = Just ident