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 relative references / traversals #532

Open
radeksimko opened this issue May 20, 2021 · 0 comments
Open

Support relative references / traversals #532

radeksimko opened this issue May 20, 2021 · 0 comments

Comments

@radeksimko
Copy link
Member

radeksimko commented May 20, 2021

Background

Support for scoped/absolute traversals, where the collection being indexed is a static traversal was added in #485 - this brought support e.g. for aws_instance.example.tags["owner"] or aws_alb.example.access_logs[0].

However Terraform also supports relative traversals, where the collection being accessed is essentially an expression of itself - e.g. a list or a function call

  • ["first", "second"][0]
  • bar(1, a)[0]
  • bar(1, a)["key"]

Language server currently does not support such expressions, which in practice means that e.g.

  • no completion is provided within an existing relative traversal, e.g. [ HERE ][0] nor bar( HERE )[0] nor ["first", "second"][ HERE ]
  • no data is provided on hover over any expression within such relative traversal expression (neither the collection nor key)
  • no tokens are highlighted within such relative traversal expressions

Proposal

Completion

TODO

Hover

TODO

Semantic Tokens

TODO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants