@@ -141,6 +141,10 @@ renderTarget t = T.intercalate "\n" $
141141annotate :: (String , String ) -> String
142142annotate (thing,url) = " [" <> thing<> " ]" <> " (" <> url<> " )"
143143
144+ -- | Hoogle results contain html like tags.
145+ -- We remove them with `tagsoup` here.
146+ -- So, if something hoogle related shows html tags,
147+ -- then maybe this function is responsible.
144148unHTML :: T. Text -> T. Text
145149unHTML = T. replace " <0>" " " . innerText . parseTags
146150
@@ -172,21 +176,14 @@ searchModules = fmap (map fst) . searchModules'
172176searchModules' :: T. Text -> IdeM [(T. Text , T. Text )]
173177searchModules' = fmap (take 5 . nub) . searchTargets retrieveModuleAndSignature
174178 where
175- -- | Hoogle results contain html like tags.
176- -- We remove them with `tagsoup` here.
177- -- So, if something hoogle related shows html tags,
178- -- then maybe this function is responsible.
179- normaliseItem :: T. Text -> T. Text
180- normaliseItem = innerText . parseTags
181-
182179 retrieveModuleAndSignature :: Target -> Maybe (T. Text , T. Text )
183180 retrieveModuleAndSignature target = liftA2 (,) (packModuleName target) (packSymbolSignature target)
184181
185182 packModuleName :: Target -> Maybe T. Text
186183 packModuleName = fmap (T. pack . fst ) . targetModule
187184
188185 packSymbolSignature :: Target -> Maybe T. Text
189- packSymbolSignature = Just . normaliseItem . T. pack . targetItem
186+ packSymbolSignature = Just . unHTML . T. pack . targetItem
190187
191188-- | Search for packages that satisfy the given search text.
192189-- Will return at most five, unique results.
0 commit comments