Skip to content

Commit

Permalink
internal/core/adt: introduce visual CUE debugger
Browse files Browse the repository at this point in the history
This adds functionality to open a Mermaid graph visualizing
the state in a browser.

Issue #2884

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: I0b59815069bffa4c66eeaac1612f955017ab8e46
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1174002
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
  • Loading branch information
mpvl committed Mar 7, 2024
1 parent 7d4d90d commit 37c0260
Show file tree
Hide file tree
Showing 5 changed files with 540 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cmd/cue/cue
**/__debug_bin*
**/.DS_Store
**/*.exe
**/.debug

# We use test module paths like mod.test or externalmod.test.
# Don't exclude those as if they were test binaries.
Expand Down
4 changes: 4 additions & 0 deletions internal/core/adt/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ type OpContext struct {
// as an error if this is true.
// TODO: strictly separate validators and functions.
IsValidator bool

// ErrorGraphs contains an analysis, represented as a Mermaid graph, for
// each node that has an error.
ErrorGraphs map[string]string
}

func (c *OpContext) CloseInfo() CloseInfo { return c.ci }
Expand Down
Loading

0 comments on commit 37c0260

Please sign in to comment.