File tree 4 files changed +34
-3
lines changed
main/scala/nz/co/bottech/scala2plantuml
test/scala/nz/co/bottech/scala2plantuml
examples/methodparameters 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 {
144
144
assert(names.isEmpty)
145
145
def typeParameterSymbols (parameters : Seq [TypeParameter ]): Seq [String ] =
146
146
parameters.flatMap(parameter => parameter.symbol +: parameter.parentSymbols)
147
- // TODO: This might be overkill. All the symbols we care about should be types.
148
147
def elementSymbols (element : ClassDiagramElement ): Seq [String ] =
149
148
element match {
150
149
case typ : Type => typ.symbol +: typ.parentSymbols ++: typeParameterSymbols(typ.typeParameters)
@@ -161,8 +160,8 @@ private[scala2plantuml] object DiagramModifications {
161
160
symbolName(parameter.symbol) +: parameter.parentSymbols.map(symbolName)
162
161
}
163
162
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))
166
165
}
167
166
}
168
167
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