File tree 1 file changed +3
-6
lines changed
ghcide/src/Development/IDE/Plugin/Completions
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)
31
31
import Data.Functor
32
32
import qualified Data.HashMap.Strict as HM
33
33
import qualified Data.HashSet as HashSet
34
+ import Data.Monoid (First (.. ))
34
35
import Data.Ord (Down (Down ))
35
36
import qualified Data.Set as Set
36
37
import Development.IDE.Core.Compile
@@ -757,12 +758,8 @@ openingBacktick line prefixModule prefixText Position { _character=(fromIntegral
757
758
-}
758
759
-- TODO: Turn this into an alex lexer that discards prefixes as if they were whitespace.
759
760
stripPrefix :: 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
766
763
767
764
-- | Prefixes that can occur in a GHC OccName
768
765
prefixes :: [T. Text ]
You can’t perform that action at this time.
0 commit comments