Skip to content

Commit d429850

Browse files
committed
fix(model-server): show name for instances of INamedConcept in content explorer
1 parent 14d91dd commit d429850

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

model-server/src/main/kotlin/org/modelix/model/server/handlers/ContentExplorer.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import kotlinx.html.tr
3434
import kotlinx.html.ul
3535
import kotlinx.html.unsafe
3636
import org.modelix.model.ModelFacade
37+
import org.modelix.model.api.BuiltinLanguages
3738
import org.modelix.model.api.INodeResolutionScope
3839
import org.modelix.model.api.ITree
3940
import org.modelix.model.api.PNodeAdapter
@@ -135,7 +136,11 @@ class ContentExplorer(private val client: IModelClient, private val repoManager:
135136
div("nameField") {
136137
attributes["data-nodeid"] = node.nodeId.toString()
137138
b {
138-
if (node.getPropertyRoles().contains("name")) {
139+
val namePropertyUID = BuiltinLanguages.jetbrains_mps_lang_core.INamedConcept.name.getUID()
140+
val namedConceptName = node.getPropertyValue(namePropertyUID)
141+
if (namedConceptName != null) {
142+
+namedConceptName
143+
} else if (node.getPropertyRoles().contains("name")) {
139144
+"${node.getPropertyValue("name")}"
140145
} else {
141146
+"Unnamed Node"

0 commit comments

Comments
 (0)