Skip to content

Commit da43aa7

Browse files
committed
Add infix flag and change longer modifiers to display as ellipsis
1 parent 7d70ee8 commit da43aa7

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

scaladoc-testcases/src/tests/hugetype.scala

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,21 @@ type Take[T <: Tuple, N <: Int] <: Tuple = N match {
2525
}
2626
}
2727

28-
/**
29-
* Some important information :o
30-
*
31-
* @param a any value of type forall a. a
32-
* @return Nothing, because I haven't implemented it yet ^^
33-
*/
34-
@experimental
35-
@deprecated
36-
implicit transparent inline def same[A](a: A): A = ???
28+
trait E:
29+
@experimental
30+
@deprecated
31+
protected implicit def same[A](a: A): A
32+
33+
trait XD extends E:
34+
/**
35+
* Some important information :o
36+
*
37+
* @param a any value of type forall a. a
38+
* @return Nothing, because I haven't implemented it yet ^^
39+
*/
40+
@experimental
41+
@deprecated
42+
protected override final implicit transparent inline abstract infix def same[A](a: A): A = a
3743

3844
trait Parent[X, A[_], B[_, _]]
3945

scaladoc/resources/dotty_res/styles/scalastyle.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,15 @@ footer .mode {
588588
width: 10em;
589589
overflow: hidden;
590590
text-align: right;
591-
white-space: break-spaces;
591+
white-space: nowrap;
592+
text-overflow: ellipsis;
592593
text-indent: 0em;
594+
padding-right: 0.5em;
595+
}
596+
597+
.documentableElement.expand .modifiers {
598+
white-space: break-spaces;
599+
text-overflow: unset;
593600
}
594601

595602
.documentableElement .docs {

scaladoc/src/dotty/tools/scaladoc/api.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ enum Modifier(val name: String, val prefix: Boolean):
4141
case Opaque extends Modifier("opaque", true)
4242
case Open extends Modifier("open", true)
4343
case Transparent extends Modifier("transparent", true)
44+
case Infix extends Modifier("infix", true)
4445

4546
case class ExtensionTarget(name: String, typeParams: Seq[TypeParameter], argsLists: Seq[ParametersList], signature: Signature, dri: DRI, position: Long)
4647
case class ImplicitConversion(from: DRI, to: DRI)

scaladoc/src/dotty/tools/scaladoc/tasty/SymOps.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ object SymOps:
7070
case (None, None, (false, true, true)) => Visibility.Protected(ThisScope)
7171
case (None, None, (false, true, false)) => Visibility.Protected(implicitScope(sym.owner))
7272
case (None, None, (false, false, false)) => Visibility.Unrestricted
73+
case (None, None, (true, true, false)) => Visibility.Protected(ThisScope)
7374
case _ => throw new Exception(s"Visibility for symbol $sym cannot be determined")
7475

7576

@@ -83,12 +84,13 @@ object SymOps:
8384
Flags.Abstract -> Modifier.Abstract,
8485
Flags.Deferred -> Modifier.Deferred,
8586
Flags.Implicit -> Modifier.Implicit,
87+
Flags.Infix -> Modifier.Infix,
88+
Flags.Transparent -> Modifier.Transparent,
8689
Flags.Inline -> Modifier.Inline,
8790
Flags.Lazy -> Modifier.Lazy,
8891
Flags.Open -> Modifier.Open,
8992
Flags.Override -> Modifier.Override,
9093
Flags.Case -> Modifier.Case,
91-
Flags.Transparent -> Modifier.Transparent,
9294
).collect { case (flag, mod) if sym.flags.is(flag) => mod }
9395

9496
def isHiddenByVisibility(using dctx: DocContext): Boolean =

0 commit comments

Comments
 (0)