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

Go to definition of variable value in tfvars #581

Closed
radeksimko opened this issue Jul 7, 2021 · 3 comments
Closed

Go to definition of variable value in tfvars #581

radeksimko opened this issue Jul 7, 2021 · 3 comments
Labels

Comments

@radeksimko
Copy link
Member

Use-cases

From 0.19 users are able to go to variable definition/declaration, which is always considered to be the variable block (where value can be specified as default).

In Terraform it is also possible to specify value of a variable via tfvars file and users would benefit from being able to find the value definition of a variable from its reference (e.g. var.foo).

Proposal

TODO

@danishprakash
Copy link
Contributor

hey @radeksimko, this looks like an interesting one, mind If I take a shot at it?

@radeksimko
Copy link
Member Author

After thinking through this and trying to map LSP's concepts somehow to HCL I believe we should represent tfvars entries as references, rather than definitions for variable blocks, which is already tracked under #618

The minor difference this will make is that users would pick a different item from the context menu
Screenshot 2021-09-30 at 11 47 00

This also reflects the fact that VS Code implements UX aspect of go-to-definition as Ctrl/Cmd+click and making a variable block clickable would be slightly awkward.

The opposite should work though - i.e. tfvars entry would be considered a reference to the variable block, and so Ctrl/Cmd+click-ing on a tfvars entry will take you to the block (not the opposite, which is what this issue was proposing). Relatedly Go to Definition from tfvars would take you to the relevant variable block.

@github-actions
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 Oct 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants