File tree Expand file tree Collapse file tree 4 files changed +34
-3
lines changed
main/scala/nz/co/bottech/scala2plantuml
test/scala/nz/co/bottech/scala2plantuml
examples/methodparameters Expand file tree Collapse file tree 4 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,6 @@ private[scala2plantuml] object DiagramModifications {
129129 assert(names.isEmpty)
130130 def typeParameterSymbols (parameters : Seq [TypeParameter ]): Seq [String ] =
131131 parameters.flatMap(parameter => parameter.symbol +: parameter.parentSymbols)
132- // TODO: This might be overkill. All the symbols we care about should be types.
133132 def elementSymbols (element : ClassDiagramElement ): Seq [String ] =
134133 element match {
135134 case typ : Type => typ.symbol +: typ.parentSymbols ++: typeParameterSymbols(typ.typeParameters)
@@ -146,8 +145,8 @@ private[scala2plantuml] object DiagramModifications {
146145 symbolName(parameter.symbol) +: parameter.parentSymbols.map(symbolName)
147146 }
148147 elementName +: typeParameterNames
149- case member : Member => Seq (member.symbol -> member.displayName)
150- case _ : Aggregation => Seq .empty
148+ case member : Member => Seq (member.symbol -> member.displayName)
149+ case aggregation : Aggregation => Seq (symbolName(aggregation.aggregator), symbolName(aggregation.aggregated))
151150 }
152151 }
153152 val newNames = options.naming match {
Original file line number Diff line number Diff line change 1+ package nz .co .bottech .scala2plantuml
2+
3+ import utest .{TestSuite , Tests , test }
4+
5+ object MethodParameterTests extends TestSuite with ClassDiagramTests {
6+
7+ override protected val exampleDir : String = " methodparameters"
8+
9+ val tests : Tests = Tests {
10+ test(" parameter with type alias" ) {
11+ success(
12+ " Foo." ,
13+ """ class Foo {
14+ | + {static} {method} foo
15+ |}
16+ |Foo o-- "package$Bar"""" .stripMargin
17+ )
18+ }
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ package nz .co .bottech .scala2plantuml .examples .methodparameters
2+
3+ object Foo {
4+
5+ def foo (bar : Bar ): String = bar
6+ }
Original file line number Diff line number Diff line change 1+ package nz .co .bottech .scala2plantuml .examples
2+
3+ package object methodparameters {
4+
5+ type Bar = String
6+ }
You can’t perform that action at this time.
0 commit comments