@@ -141,6 +141,10 @@ renderTarget t = T.intercalate "\n" $
141
141
annotate :: (String , String ) -> String
142
142
annotate (thing,url) = " [" <> thing<> " ]" <> " (" <> url<> " )"
143
143
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.
144
148
unHTML :: T. Text -> T. Text
145
149
unHTML = T. replace " <0>" " " . innerText . parseTags
146
150
@@ -172,21 +176,14 @@ searchModules = fmap (map fst) . searchModules'
172
176
searchModules' :: T. Text -> IdeM [(T. Text , T. Text )]
173
177
searchModules' = fmap (take 5 . nub) . searchTargets retrieveModuleAndSignature
174
178
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
-
182
179
retrieveModuleAndSignature :: Target -> Maybe (T. Text , T. Text )
183
180
retrieveModuleAndSignature target = liftA2 (,) (packModuleName target) (packSymbolSignature target)
184
181
185
182
packModuleName :: Target -> Maybe T. Text
186
183
packModuleName = fmap (T. pack . fst ) . targetModule
187
184
188
185
packSymbolSignature :: Target -> Maybe T. Text
189
- packSymbolSignature = Just . normaliseItem . T. pack . targetItem
186
+ packSymbolSignature = Just . unHTML . T. pack . targetItem
190
187
191
188
-- | Search for packages that satisfy the given search text.
192
189
-- Will return at most five, unique results.
0 commit comments