-
Notifications
You must be signed in to change notification settings - Fork 1.1k
How to document using
parameters
#10526
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
Comments
For now, the solution is to simply name the parameters. There is an analogous problem with linking to anonymous |
This issue was created after I tried that.
|
One of the problems that I saw is that we'd need to parse those types in the doctool, to see if they match. But perhaps we don't need to do that? Perhaps we should identify the parameter simply based on the string representation of the type? This could help with givens as well. |
@abgruszecki are you working on this? Or can I try to fix this issue? |
@BarkingBad go ahead! |
@BarkingBad for clarity, we should try to at least render the |
I hope the issue of keyword in signature was addressed in #10800. As it comes to problem with description, I think we don't have to bother with this problem at all. In Scala3doc for each
What's your opinion about that? Can we close it? |
I think it'd be better if we'd have a separate section for context (using?) parameters. The documentation will look better if there's a separate section, I think, and it'll be possible to check if the parameter with the appropriate name/type actually exists. |
What do you think of documenting parameters directly, rather than in the scaladoc comment attached to their method/class definition? E.g.: /** A Foo */
case class Foo(
/** An x */
x: Int
)
def bar(
/** A Bah */
bah: Bah
)(using
/** Context Quux */
Quux
): Unit I think this would be useful outside of |
In my opinion inline comments would be too unmanageable for longer params descriptions. As for separate section, it is really easy fix to do, and it makes sense. However, validation of name/type existance is a little bit more complex and we should discuss it how we would like to do that |
@julienrf I think for some usecases being able to define comments together with the parameters could be nice. I'm not sure if it's entirely easy to do though, given that we load docstrings from Tasty and that each docstring needs to be associated with a symbol. @BarkingBad we definitely should leave out the validation part for now. Validating parameter names shouldn't be too difficult. Validating the types is an entirely different level of problem. Still, I'd like to leave the door open for implementing the feature later. |
I think this issue is no longer valid, as we have keyword in sigantures for |
Can we use
@param
to generate documentation for implicit parameters?With somthig like the following:
The text was updated successfully, but these errors were encountered: