-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
schema: Introduce Extensions
to BodySchema
#118
Closed
6 tasks done
Labels
enhancement
New feature or request
Comments
This was referenced Jun 1, 2022
Support
self.*
references in provisioner
, connection
and lifecycle
blocks
hashicorp/terraform-ls#859
Closed
This was implemented as part of the following PRs:
Therefore I am going to close this. A few follow-up issues were created to track some future fixes and enhancements which can be addressed individually. |
38 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: