Skip to content

Commit 8aa5769

Browse files
committed
internal/core/adt: pass closeContext to openDebugGraph
This allows indicating for which closeContext a graph was opened, for added context, and it allows each graph to retain its own window. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I8d973b9b90998d2be754371d6ab267c6ddabb12d Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1205362 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Matthew Sackman <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 9b61fc0 commit 8aa5769

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: internal/core/adt/debug.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,10 @@ func OpenNodeGraph(title, path, code, out, graph string) {
140140
// and all its dependencies that have not completed processing.
141141
// DO NOT DELETE: this is used to insert during debugging of the evaluator
142142
// to inspect a node.
143-
func openDebugGraph(ctx *OpContext, v *Vertex, name string) {
143+
func openDebugGraph(ctx *OpContext, cc *closeContext, name string) {
144+
v := cc.src
144145
graph, _ := CreateMermaidGraph(ctx, v, true)
145-
path := filepath.Join(".debug", "TestX", name)
146+
path := filepath.Join(".debug", "TestX", name, fmt.Sprintf("%p", cc))
146147
OpenNodeGraph(name, path, "in", "out", graph)
147148
}
148149

Diff for: internal/core/adt/fields.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ func (c *closeContext) incDependent(ctx *OpContext, kind depKind, dependant *clo
557557
debug = c.addDependent(ctx, kind, dependant)
558558

559559
if c.done {
560-
openDebugGraph(ctx, c.src, "incDependent: already checked")
560+
openDebugGraph(ctx, c, "incDependent: already checked")
561561

562562
panic(fmt.Sprintf("incDependent: already closed: %p", c))
563563
}

0 commit comments

Comments
 (0)