Skip to content
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 for-in-if expressions #527

Closed
radeksimko opened this issue May 20, 2021 · 1 comment · Fixed by hashicorp/hcl-lang#368
Closed

Support for-in-if expressions #527

radeksimko opened this issue May 20, 2021 · 1 comment · Fixed by hashicorp/hcl-lang#368
Assignees

Comments

@radeksimko
Copy link
Member

radeksimko commented May 20, 2021

Background

Terraform supports for expressions. For example:

  • [for s in var.list : upper(s)]
  • [for k, v in var.map : length(k) + length(v)]
  • {for s in var.list : s => upper(s)}
  • [for s in var.list : upper(s) if s != ""]

Language server currently doesn't support these, which means that e.g.

  • LS doesn't suggest for while completing the inside of a list/set (within square brackets [ ])
  • LS doesn't provide completion for the in part of a for expression, e.g. [for s in _HERE_, nor the result after :, nor after if clause
  • LS doesn't display any details (such as type or description) on hover over for expressions
  • LS doesn't highlight valid expressions surrounding for/in/if via semantic tokens

Proposal

Completion

TODO

Hover

TODO

Semantic Tokens

TODO

@xiehan xiehan added this to the v0.31.0 milestone Oct 27, 2022
@xiehan xiehan modified the milestones: v0.31.0, v0.34.0 (tentative) Mar 10, 2023
@radeksimko radeksimko self-assigned this Jan 10, 2024
@xiehan xiehan removed this from the v0.34.0 (tentative) milestone Jan 22, 2024
Copy link

github-actions bot commented Mar 8, 2024

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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants