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 @@ -144,7 +144,6 @@ private[scala2plantuml] object DiagramModifications {
144144 assert(names.isEmpty)
145145 def typeParameterSymbols (parameters : Seq [TypeParameter ]): Seq [String ] =
146146 parameters.flatMap(parameter => parameter.symbol +: parameter.parentSymbols)
147- // TODO: This might be overkill. All the symbols we care about should be types.
148147 def elementSymbols (element : ClassDiagramElement ): Seq [String ] =
149148 element match {
150149 case typ : Type => typ.symbol +: typ.parentSymbols ++: typeParameterSymbols(typ.typeParameters)
@@ -161,8 +160,8 @@ private[scala2plantuml] object DiagramModifications {
161160 symbolName(parameter.symbol) +: parameter.parentSymbols.map(symbolName)
162161 }
163162 elementName +: typeParameterNames
164- case member : Member => Seq (member.symbol -> member.displayName)
165- case _ : Aggregation => Seq .empty
163+ case member : Member => Seq (member.symbol -> member.displayName)
164+ case aggregation : Aggregation => Seq (symbolName(aggregation.aggregator), symbolName(aggregation.aggregated))
166165 }
167166 }
168167 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 .{test , TestSuite , Tests }
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