mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Structured plan renderer: Introduce support for multiline and JSON strings (#32488)
* pause implementation * change -> diff, value -> change * add support for json and multiline strings to the primitive renderer * goimports * remove unused function * go fmt * address comments
This commit is contained in:
@@ -3,12 +3,11 @@ package differ
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/hashicorp/terraform/internal/command/jsonformat/computed"
|
||||
|
||||
"github.com/hashicorp/terraform/internal/command/jsonformat/computed/renderers"
|
||||
|
||||
"github.com/zclconf/go-cty/cty"
|
||||
|
||||
"github.com/hashicorp/terraform/internal/command/jsonformat/collections"
|
||||
"github.com/hashicorp/terraform/internal/command/jsonformat/computed"
|
||||
"github.com/hashicorp/terraform/internal/command/jsonformat/computed/renderers"
|
||||
"github.com/hashicorp/terraform/internal/command/jsonprovider"
|
||||
"github.com/hashicorp/terraform/internal/plans"
|
||||
)
|
||||
@@ -19,7 +18,7 @@ func (change Change) computeAttributeDiffAsSet(elementType cty.Type) computed.Di
|
||||
change.processSet(false, func(value Change) {
|
||||
element := value.computeDiffForType(elementType)
|
||||
elements = append(elements, element)
|
||||
current = compareActions(current, element.Action)
|
||||
current = collections.CompareActions(current, element.Action)
|
||||
})
|
||||
return computed.NewDiff(renderers.Set(elements), current, change.replacePath())
|
||||
}
|
||||
@@ -33,7 +32,7 @@ func (change Change) computeAttributeDiffAsNestedSet(attributes map[string]*json
|
||||
NestingMode: "single",
|
||||
})
|
||||
elements = append(elements, element)
|
||||
current = compareActions(current, element.Action)
|
||||
current = collections.CompareActions(current, element.Action)
|
||||
})
|
||||
return computed.NewDiff(renderers.Set(elements), current, change.replacePath())
|
||||
}
|
||||
@@ -44,7 +43,7 @@ func (change Change) computeBlockDiffsAsSet(block *jsonprovider.Block) ([]comput
|
||||
change.processSet(true, func(value Change) {
|
||||
element := value.ComputeDiffForBlock(block)
|
||||
elements = append(elements, element)
|
||||
current = compareActions(current, element.Action)
|
||||
current = collections.CompareActions(current, element.Action)
|
||||
})
|
||||
return elements, current
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user