Skip to content
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

Backport "fix(#19377): show inherited abstract members in dedicated section" to LTS #20881

Open
wants to merge 1 commit into
base: lts-19592
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scaladoc-testcases/src/tests/abstractmembersignatures.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ trait TestTrait:
class TestClass:
def shouldBeConcrete: Int = 1

abstract class TestInheritedAbstractMembers extends TestTrait

abstract class AbstractTestClass:
def shouldBeAbstract: Int
def shouldBeConcrete: Int = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext
val (allInherited, allDefined) = nonExperimental.partition(isInherited)
val (depDefined, defined) = allDefined.partition(isDeprecated)
val (depInherited, inherited) = allInherited.partition(isDeprecated)
val (abstractInherited, concreteInherited) = inherited.partition(isAbstract)
val normalizedName = name.toLowerCase
val definedWithGroup = if Set("methods", "fields").contains(normalizedName) then
val (abstr, concr) = defined.partition(isAbstract)
Expand All @@ -335,7 +336,8 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext

definedWithGroup ++ List(
actualGroup(s"Deprecated ${normalizedName}", depDefined),
actualGroup(s"Inherited ${normalizedName}", inherited),
actualGroup(s"Inherited ${normalizedName}", concreteInherited),
actualGroup(s"Inherited and Abstract ${normalizedName}", abstractInherited),
actualGroup(s"Deprecated and Inherited ${normalizedName}", depInherited),
actualGroup(name = s"Experimental ${normalizedName}", experimental)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class AbstractMembers extends ScaladocTest("abstractmembersignatures"):
def runTest = {
afterRendering {
val actualSignatures = signaturesFromDocumentation()

actualSignatures.foreach { (k, v) => k match
case "Abstract methods" => assertTrue(v.forall(_._2 == "shouldBeAbstract"))
case "Concrete methods" => assertTrue(v.forall(_._2 == "shouldBeConcrete"))
case "Inherited and Abstract methods" => assertTrue(v.forall(_._2 == "shouldBeAbstract"))
case "Classlikes" => assertTrue(v.forall((m, n) => m.contains("abstract") == n.contains("Abstract")))
case _ =>
}
Expand Down