Skip to content

rip custom productElementLabel - use standard productElementName instead #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2023
Merged
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
13 changes: 5 additions & 8 deletions codegen/src/main/scala/overflowdb/codegen/CodeGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,6 @@ class CodeGen(schema: Schema) {
| * since this is a StoredNode, this is always set */
| def underlying: Node = this
|
| /** labels of product elements, used e.g. for pretty-printing */
| def productElementLabel(n: Int): String
|
| /* all properties plus label and id */
| def toMap: Map[String, Any] = {
| val map = propertiesMap()
Expand Down Expand Up @@ -889,7 +886,7 @@ class CodeGen(schema: Schema) {
forId +: (forKeys ++ forContainedNodes)
}

val productElementLabels =
val productElementNames =
productElements.map { case ProductElement(name, _, index) =>
s"""case $index => "$name" """
}.mkString(lineSeparator)
Expand Down Expand Up @@ -973,9 +970,9 @@ class CodeGen(schema: Schema) {
| $className.Label
| }
|
| override def productElementLabel(n: Int): String =
| override def productElementName(n: Int): String =
| n match {
| $productElementLabels
| $productElementNames
| }
|
| override def productElement(n: Int): Any =
Expand Down Expand Up @@ -1121,9 +1118,9 @@ class CodeGen(schema: Schema) {
| $className.Label
| }
|
| override def productElementLabel(n: Int): String =
| override def productElementName(n: Int): String =
| n match {
| $productElementLabels
| $productElementNames
| }
|
| override def productElement(n: Int): Any =
Expand Down