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 more complex index expressions (elem[key]) #531

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

Support more complex index expressions (elem[key]) #531

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

Comments

@radeksimko
Copy link
Member

radeksimko commented May 20, 2021

Use-cases

Support for traversals was added in #485 - which introduced support for simple index expressions the element is a reference and key is static (either number or string), such as aws_instance.example.tags["owner"] or aws_alb.example.access_logs[0].

Terraform however supports more complex index expressions too, where the key can a (non-static) expression, for example:

  • aws_instance.example.tags[var.tag_name]

Language server currently does not support such expressions, which in practice means that:

  • no completion is provided within the square brackets [ ] for variable index
  • no completion is provided anywhere else within the expression
  • no data is provided on hover over any expressions within such index expression (neither collection nor key)
  • no tokens are highlighted within for such complex index expression or any expressions within it

Related

#1283

Proposal

Completion

TODO

Hover

TODO

Semantic Tokens

TODO

Copy link

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 Feb 22, 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.

3 participants