Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ private[scala2plantuml] object DiagramModifications {
assert(names.isEmpty)
def typeParameterSymbols(parameters: Seq[TypeParameter]): Seq[String] =
parameters.flatMap(parameter => parameter.symbol +: parameter.parentSymbols)
// TODO: This might be overkill. All the symbols we care about should be types.
def elementSymbols(element: ClassDiagramElement): Seq[String] =
element match {
case typ: Type => typ.symbol +: typ.parentSymbols ++: typeParameterSymbols(typ.typeParameters)
Expand All @@ -161,8 +160,8 @@ private[scala2plantuml] object DiagramModifications {
symbolName(parameter.symbol) +: parameter.parentSymbols.map(symbolName)
}
elementName +: typeParameterNames
case member: Member => Seq(member.symbol -> member.displayName)
case _: Aggregation => Seq.empty
case member: Member => Seq(member.symbol -> member.displayName)
case aggregation: Aggregation => Seq(symbolName(aggregation.aggregator), symbolName(aggregation.aggregated))
}
}
val newNames = options.naming match {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package nz.co.bottech.scala2plantuml

import utest.{test, TestSuite, Tests}

object MethodParameterTests extends TestSuite with ClassDiagramTests {

override protected val exampleDir: String = "methodparameters"

val tests: Tests = Tests {
test("parameter with type alias") {
success(
"Foo.",
"""class Foo {
| + {static} {method} foo
|}
|Foo o-- "package$Bar"""".stripMargin
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package nz.co.bottech.scala2plantuml.examples.methodparameters

object Foo {

def foo(bar: Bar): String = bar
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package nz.co.bottech.scala2plantuml.examples

package object methodparameters {

type Bar = String
}