Skip to content

Commit b78cd3f

Browse files
committed
Filter names from hovertip documentation which match patterns of generated Core variables.
1 parent aeb57a8 commit b78cd3f

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
@@ -225,10 +225,17 @@ atPoint IdeOptions{} (HAR _ hf _ _ kind) (DKMap dm km) env pos = listToMaybe $ p
225225
wrapHaskell x = "\n```haskell\n"<>x<>"\n```\n"
226226
info = nodeInfoH kind ast
227227
names = M.assocs $ nodeIdentifiers info
228+
isInternal :: (Identifier, IdentifierDetails a) -> Bool
229+
isInternal (Right n, _) =
230+
let name = printOutputable n
231+
prefix = T.take 2 name
232+
in elem prefix ["$d", "$c"]
233+
isInternal (Left _, _) = False
234+
filteredNames = filter (not . isInternal) names
228235
types = nodeType info
229236

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

0 commit comments

Comments
 (0)