schema: Introduce Extensions
to BodySchema
#118
Closed
6 tasks done
Labels
enhancement
New feature or request
Background
There is a number of "extensions" to HCL. Features which are not natively supported, or rather implemented by the tool such as Terraform.
count
meta-attribute +count.index
refsfor_each
meta-attribute +each.*
refsself.*
refs withinprovisioner
,connection
orlifecycle
'sprecondition
/postcondition
insideresource
dynamic "block-name"
+block-name.*
refsdynamic
blocksdynamic
blocksdynamic
blocksThree of the above features are Terraform specific, but it would be likely difficult to try to express how these features work via schema alone. It seems more sensible to introduce them as features to
hcl-lang
and then have individual servers just opt in via schema.Proposal
The proposal is based on a prototype available https://github.com/hashicorp/hcl-lang/compare/f-local-refs and https://github.com/hashicorp/terraform-schema/compare/f-local-refs
BodyExtensions
toBodySchema
to allow any body such asprovisioner
to opt into any extensionLocalAddr
toreference.Target
LocalAddr
is filled as part ofCollectReferenceTargets
BodyExtensions
inCandidatesAtPos()
BodyExtensions
inHoverAtPos()
BodyExtensions
inSemanticTokensInFile()
Unknowns
Once supported per hashicorp/terraform-schema#92 Terraform's precondition/postcondition blocks may need some minor adjustments as these are more than 1 level away from the relevant block they refer to.
The text was updated successfully, but these errors were encountered: