-
Notifications
You must be signed in to change notification settings - Fork 131
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
Support each.*
references in blocks w/ for_each
#861
Labels
enhancement
New feature or request
textDocument/completion
textDocument/hover
textDocument/semanticTokens
Semantic syntax highlighting
Milestone
Comments
radeksimko
added
enhancement
New feature or request
textDocument/completion
textDocument/definition
textDocument/hover
textDocument/references
textDocument/semanticTokens
Semantic syntax highlighting
labels
Apr 7, 2022
7 tasks
jpogran
added a commit
to hashicorp/hcl-lang
that referenced
this issue
Oct 28, 2022
This provides completion hints inside blocks for `for_each` and `each.*` references within `resource`, `data` and `module` blocks anywhere the `for_each` meta-argument is supported. It detects if `for_each` is used already and does not suggest duplicates and detects when it is necessary to provide `each.*` completions. This does not complete the values for `each.key` and `each.value`, e.g. `each.value.something`. This also provides hover support for `for_each` and `each.*` references using the documentation as source. This also provides semantic token support for `for_each` and `each.*` references. Closes hashicorp/terraform-ls#861
jpogran
added a commit
to hashicorp/hcl-lang
that referenced
this issue
Oct 28, 2022
This provides completion hints inside blocks for `for_each` and `each.*` references within `resource`, `data` and `module` blocks anywhere the `for_each` meta-argument is supported. It detects if `for_each` is used already and does not suggest duplicates and detects when it is necessary to provide `each.*` completions. This does not complete the values for `each.key` and `each.value`, e.g. `each.value.something`. This also provides hover support for `for_each` and `each.*` references using the documentation as source. This also provides semantic token support for `for_each` and `each.*` references. Closes hashicorp/terraform-ls#861
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
enhancement
New feature or request
textDocument/completion
textDocument/hover
textDocument/semanticTokens
Semantic syntax highlighting
Background
Terraform supports
each.key
andeach.value
references withinresource
,data
ormodule
block and anywhere wherefor_each
meta-argument is supported, for examplehttps://www.terraform.io/language/expressions/references#block-local-values
https://www.terraform.io/language/meta-arguments/for_each
We don't provide any kind of support for this type of reference and if we were to do any kind of thorough validation of them we'd probably flag them as invalid today.
Expected UX
Completion
Hover
Semantic Highlighting
Proposal
hashicorp/hcl-lang
BodyExtensions{ForEach bool}
intoschema.BodySchema
ForEach
indecoder.PathDecoder.CandidatesAtPos()
ForEach
indecoder.PathDecoder.HoverAtPos()
ForEach
indecoder.PathDecoder.SemanticTokensInFile()
ForEach
indecoder.Decoder.Symbols()
hashicorp/terraform-schema
for_each
attribute withBodyExtensions{ForEach: true}
inresource
,data
andmodule
block bodieshashicorp/terraform-ls
terraform-schema
&hcl-lang
The text was updated successfully, but these errors were encountered: