Re-add ohthetreesyoullgrow partner

This commit is contained in:
Misode
2024-10-31 06:41:30 +01:00
parent cf44c3236f
commit 68eb077c17
10 changed files with 104 additions and 106 deletions

View File

@@ -474,7 +474,7 @@ function StructBody({ type: outerType, node, makeEdit, ctx }: Props<SimplifiedSt
staticChilds.push(pair)
}
const child = pair?.value
const childType = simplifyType(field.type, ctx, pair)
const childType = simplifyType(field.type, ctx, { key: pair?.key, parent: node })
const makeFieldEdit: MakeEdit = (edit) => {
if (pair) {
makeEdit(() => {
@@ -562,7 +562,7 @@ function StructBody({ type: outerType, node, makeEdit, ctx }: Props<SimplifiedSt
return
}
makeEdit((range) => {
const valueNode = getDefault(simplifyType(field.type, ctx, pair), range, ctx)
const valueNode = getDefault(simplifyType(field.type, ctx, { key: pair.key, parent: node }), range, ctx)
const newPair: core.PairNode<JsonStringNode, JsonNode> = {
type: 'pair',
range: keyNode.range,
@@ -600,7 +600,7 @@ function StructBody({ type: outerType, node, makeEdit, ctx }: Props<SimplifiedSt
if (!field) {
return <></>
}
const childType = simplifyType(field.type, ctx, pair)
const childType = simplifyType(field.type, ctx, { key: pair.key, parent: node })
const makeFieldEdit: MakeEdit = (edit) => {
makeEdit(() => {
const newChild = edit(child?.range ?? core.Range.create(pair.range.end))