-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Handle deprecated signatures in Scala3doc #10595
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
Conversation
2c86bd7
to
8ec8a2a
Compare
3b14a9f
to
46f6f85
Compare
…r than some synthetic def
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor code style issue plus question about Java.
If Java does not work we can add support for it in a followup PR
case class PrimitiveParameter(val name: Option[String] = None, val value: String) extends AnnotationParameter | ||
case class LinkParameter(val name: Option[String] = None, val dri: DRI, val value: String) extends AnnotationParameter | ||
case class UnresolvedParameter(val name: Option[String] = None, val unresolvedText: String) extends AnnotationParameter | ||
sealed trait AnnotationParameter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not thing that we should mix non-braces and braces in our code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change
@@ -124,6 +126,7 @@ extension[T] (member: Member): | |||
|
|||
def signature: Signature = memberExt.fold(Signature(name))(_.signature) | |||
def asLink: LinkToType = LinkToType(signature, dri, kind) | |||
def deprecated: Option[Annotation] = memberExt.flatMap(_.annotations.find(a => a.dri.getPackageName == "scala" && a.dri.getClassNames == "deprecated")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we are have a deprecated member from Java?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends. It still will be recognized as an annotation, though it won't have added strikethrough style. The question is: if we really find that using java.lang.Deprecated
in Scala code should cause any special treatment. In my opinion it's user fault
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if one want to use a Java class with deprecated members (e.g. this one )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean as a base class for Scala class... Yeah, we would like to make the Inherited methods deprecated. Will add support then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be done in follow up PR
No description provided.