Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show documentation for value forwarders in completions #19200

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -100,6 +100,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
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class CompletionDocSuite extends BaseCompletionSuite:
""".stripMargin,
"""
|> Found documentation for scala/package.Vector.
|Vector: scala.collection.immutable
|Vector scala.collection.immutable
|""".stripMargin,
includeDocs = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CompletionSuite extends BaseCompletionSuite:
| Lis@@
|}""".stripMargin,
"""
|List: scala.collection.immutable
|List scala.collection.immutable
|List - java.awt
|List - java.util
|List - scala.collection.immutable
Expand Down Expand Up @@ -647,7 +647,7 @@ class CompletionSuite extends BaseCompletionSuite:
|}
|""".stripMargin,
"""|None scala
|NoManifest: scala.reflect
|NoManifest scala.reflect
|""".stripMargin,
topLines = Some(2)
)
Expand All @@ -660,8 +660,8 @@ class CompletionSuite extends BaseCompletionSuite:
|}
|""".stripMargin,
"""|Some(value) scala
|Seq: scala.collection.immutable
|Set: scala.collection.immutable
|Seq scala.collection.immutable
|Set scala.collection.immutable
|""".stripMargin,
topLines = Some(3)
)
Expand Down
Loading