Skip to content

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

Merged
merged 3 commits into from
Dec 7, 2020
Merged

Handle deprecated signatures in Scala3doc #10595

merged 3 commits into from
Dec 7, 2020

Conversation

BarkingBad
Copy link
Contributor

No description provided.

@BarkingBad BarkingBad marked this pull request as ready for review December 7, 2020 14:29
Copy link
Contributor

@romanowski romanowski left a 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 {
Copy link
Contributor

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

Copy link
Contributor Author

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"))
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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 )

Copy link
Contributor Author

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

Copy link
Contributor

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

@romanowski romanowski merged commit c042be9 into master Dec 7, 2020
@romanowski romanowski deleted the deprecated branch December 7, 2020 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants