diff --git a/d2oracle/edit.go b/d2oracle/edit.go index e431d4b681..590ce83860 100644 --- a/d2oracle/edit.go +++ b/d2oracle/edit.go @@ -1489,6 +1489,7 @@ func move(g *d2graph.Graph, key, newKey string, includeDescendants bool) (*d2gra } } + println(d2format.Format(g.AST)) // 2. Ensure parent node Key has a map to accept moved node. // This map will be what MOVE will append the new key to toScope := g.AST diff --git a/d2oracle/edit_test.go b/d2oracle/edit_test.go index 0fbaedd30d..caf6a7b4e1 100644 --- a/d2oracle/edit_test.go +++ b/d2oracle/edit_test.go @@ -3331,6 +3331,22 @@ c exp: `x: { y.a -> y.b } +`, + }, + { + name: "underscore_edge_container_7", + + text: `x: { + _.y.a -> _.y.b +} +`, + key: `x`, + newKey: `y.x`, + includeDescendants: false, + + exp: `x: { + y.a -> y.b +} `, }, {