Report the canonical node path in load errors

This commit is contained in:
lilleman
2026-08-27 23:25:53 +02:00
committed by lilleman-tw
parent e6afd089e2
commit f03825671e
2 changed files with 9 additions and 1 deletions
+4 -1
View File
@@ -114,8 +114,11 @@ func (f *Fakes) List() []string {
}
func join(prefix, name string) string {
if prefix == "" {
switch {
case prefix == "":
return name
case name == "":
return prefix
}
return prefix + "." + name
}
+5
View File
@@ -90,9 +90,14 @@ func contained(n node) []namedNode {
}
}
// named skips a bound {..path} key: it is a render edge, not containment, so using
// it as a path segment would report a node under a path that does not reach it.
func named(m map[string]node) []namedNode {
out := make([]namedNode, 0, len(m))
for _, name := range sortedNames(m) {
if isRef(name) {
continue
}
out = append(out, namedNode{name: name, node: m[name]})
}
return out