Skip to content

Commit

Permalink
Backport "Show documentation for value forwarders in completions" to …
Browse files Browse the repository at this point in the history
…LTS (#20788)

Backports #19200 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jun 26, 2024
2 parents 3c46a50 + 7d9cadf commit 8b20064
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ object CompletionItemResolver extends ItemResolver:
fullDocstring(tr.symbol, search)
case _ =>
""
else if gsym.isTerm && gsym.info.typeSymbol.is(Module) then
fullDocstring(gsym.info.typeSymbol.companion, search)
else ""
else gsymDoc
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ object CompletionValue:
s"${labelWithSuffix(printer)} -${description(printer)}"
else s"${labelWithSuffix(printer)}${description(printer)}"
else if symbol.isType then labelWithSuffix(printer)
else if symbol.isTerm && symbol.info.typeSymbol.is(Module) then
s"${label}${description(printer)}"
else s"$label: ${description(printer)}"

private def labelWithSuffix(printer: ShortenedTypePrinter)(using Context): String =
Expand Down

0 comments on commit 8b20064

Please sign in to comment.