Skip to content

Commit 9e86954

Browse files
committed
Filter names from hovertip documentation which match patterns of generated Core variables.
1 parent 065957e commit 9e86954

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ghcide/src/Development/IDE/Spans/AtPoint.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,17 @@ atPoint IdeOptions{} (HAR _ hf _ _ kind) (DKMap dm km) env pos = listToMaybe $ p
227227
wrapHaskell x = "\n```haskell\n"<>x<>"\n```\n"
228228
info = nodeInfoH kind ast
229229
names = M.assocs $ nodeIdentifiers info
230+
isInternal :: (Identifier, IdentifierDetails a) -> Bool
231+
isInternal (Right n, _) =
232+
let name = printOutputable n
233+
prefix = T.take 2 name
234+
in elem prefix ["$d", "$c"]
235+
isInternal (Left _, _) = False
236+
filteredNames = filter (not . isInternal) names
230237
types = nodeType info
231238

232239
prettyNames :: [T.Text]
233-
prettyNames = map prettyName names
240+
prettyNames = map prettyName filteredNames
234241
prettyName (Right n, dets) = T.unlines $
235242
wrapHaskell (printOutputable n <> maybe "" (" :: " <>) ((prettyType <$> identType dets) <|> maybeKind))
236243
: maybeToList (pretty (definedAt n) (prettyPackageName n))

0 commit comments

Comments
 (0)