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
Improve discoverability of methods in companion objects #9009
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9009?orig=1 |
@heathermiller said: I actually don't think the desire/idea expressed in #9009 (list companion object members in their companion class/traits) is particularly good. (Companion) objects are used differently than instances of classes. If the documentation makes it appear as if there are members on classes that don't really exist there, then more confusion is added to the mix down the road (and I do understand you're advocating for a second list at the bottom of the page). It allows people to continue operating without understanding the fundamental difference between classes and their companion objects. My feeling is that if someone is frustrated because they can't find a member, and they're looking in the wrong place (e.g., class instead of companion object), we should help them learn the distinction between the two, so that in the future they know where to look.
|
@heathermiller said: Let's say you have already instantiated an array called For that reason, I argue against listing An additional problem I have with this – I suspect that if you combine companion object members with companion class/trait members, on the class/trait page, you'd be generating an awful lot of noise. Especially if some companion object contains many members. |
@heathermiller said:
|
@SethTisue said: |
Addendum to #9006, instead of merely making the links to companions more obvious, combine the trait/class and companion object into a single page with anchor tags to retain the current navigation but also improve the experience, allowing Ctrl-F to find a method on the page in either class/trait or companion, and also show the companion when simply browsing through the page.
The text was updated successfully, but these errors were encountered: