Skip to content

Commit 0d452e6

Browse files
committed
Hide default values of annotations since we cannot extract them better than some synthetic def
1 parent 46f6f85 commit 0d452e6

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

scala3doc-testcases/src/tests/deprecated.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class A:
55
def defInt: Int = 1
66
@deprecated(message = "1")
77
def def1: 1 = 1
8-
@deprecated
8+
@deprecated("reason")
99
val valInt: Int = 1
1010
val val1: 1 = 1
1111
var varInt: Int = 1

scala3doc/src/dotty/dokka/tasty/BasicSupport.scala

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ trait BasicSupport:
1717
val dri = annotTerm.tpe.typeSymbol.dri
1818
val params = annotTerm match
1919
case Apply(target, appliedWith) => {
20-
appliedWith.map {
21-
case Literal(constant) => Annotation.PrimitiveParameter(None, constant.value match {
20+
appliedWith.flatMap {
21+
case Literal(constant) => Some(Annotation.PrimitiveParameter(None, constant.value match {
2222
case s: String => "\"" + s"$s" + "\""
2323
case other => other.toString()
24-
})
25-
case NamedArg(name, Literal(constant)) => Annotation.PrimitiveParameter(Some(name), constant.value match
24+
}))
25+
case NamedArg(name, Literal(constant)) => Some(Annotation.PrimitiveParameter(Some(name), constant.value match
2626
case s: String => "\"" + s"$s" + "\""
2727
case other => other.toString()
28-
)
29-
case x @ Select(qual, name) =>
30-
val dri = qual.tpe.termSymbol.companionClass.dri
31-
Annotation.LinkParameter(None, dri, s"${dri.getClassNames}.$name") // TODO this is a nasty hack!
32-
case other => Annotation.UnresolvedParameter(None, other.show)
28+
))
29+
case x @ Select(qual, name) => None
30+
case other => Some(Annotation.UnresolvedParameter(None, other.show))
3331
}
3432
}
3533

0 commit comments

Comments
 (0)