File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
ghcide/src/Development/IDE/Plugin/Completions Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import Data.Function (on)
3131import Data.Functor
3232import qualified Data.HashMap.Strict as HM
3333import qualified Data.HashSet as HashSet
34+ import Data.Monoid (First (.. ))
3435import Data.Ord (Down (Down ))
3536import qualified Data.Set as Set
3637import Development.IDE.Core.Compile
@@ -757,12 +758,8 @@ openingBacktick line prefixModule prefixText Position { _character=(fromIntegral
757758 -}
758759-- TODO: Turn this into an alex lexer that discards prefixes as if they were whitespace.
759760stripPrefix :: T. Text -> T. Text
760- stripPrefix name = T. takeWhile (/= ' :' ) $ go prefixes
761- where
762- go [] = name
763- go (p: ps)
764- | T. isPrefixOf p name = T. drop (T. length p) name
765- | otherwise = go ps
761+ stripPrefix name = T. takeWhile (/= ' :' ) $ fromMaybe name $
762+ getFirst $ foldMap (First . (`T.stripPrefix` name)) prefixes
766763
767764-- | Prefixes that can occur in a GHC OccName
768765prefixes :: [T. Text ]
You can’t perform that action at this time.
0 commit comments