Consider different schema representations for variable defaults (to aid highlighting variable
name)
#96
Labels
enhancement
New feature or request
variable
name)
#96
Background
Currently we pre-decode variable blocks (via earlydecoder) for
type
and we use that in the 2nd (real) decoding in combination with DependentBody to inform what typedefault
is:terraform-schema/schema/schema_merge.go
Lines 240 to 261 in faadc57
This has the benefit of providing more contextual/relevant help for defaults, e.g.

However the downside is that we also use the existence of

DependentBody
to inform the user of which label or attribute has "pre-set" (enum) values, which has the less desirable effect here in the variable block, as demonstrated by semantic highlighting in hashicorp/terraform-ls#817Proposal
Explore how else we could signify the relationship between
type
anddefault
which doesn't involveDependentBody
or consider adding a flag toLabelSchema
which would control whether the label should be reported as dependent. We already haveCompletable
flag there for similar reasons.The text was updated successfully, but these errors were encountered: