-
Notifications
You must be signed in to change notification settings - Fork 138
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
textDocument/complete: Complete references to named values #38
Comments
Since this is the issue being referenced in the issues on autocomplete, I just wanted to say that All Autocomplete has been a good workaround for me in the interim. You have to load your project files so that it's aware of variables but it's transparent otherwise. https://marketplace.visualstudio.com/items?itemName=Atishay-Jain.All-Autocomplete |
Initial support for references was added in (now merged) #485 which will be released in coming days. The same PR also includes some description of features added and links to follow-up issues covering features which were omitted from that initial PR. With that in mind I'm going to close this issue but keep an eye out for the upcoming update (0.17.0). |
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. |
Context
Currently the LS completes block's known attributes and nested blocks per schema and naively assumes values are static.
Terraform language supports references to named values which are generally formatted as dot-based addresses, e.g.
can be referenced as
var.example
ordata.aws_availability_zones.names
respectively elsewhere in the configuration.Requirements
Completing the references requires LS understanding a couple of things it doesn't understand today:
var.<name>
belongs tovariable
block and evaluates to variable's value (which may come from itsdefault
)local
values can be referenced between each other, butvariable
s can notbackend
blocks do not support any kind of interpolationprovider
blocks have limited interpolation capabilities (e.g. viaalias
)var.number
for a string attribute)How could we tackle this
This will likely require extensive design work to ensure stability and maintainability over time. There is a number of factors to consider, e.g.
For reasons above I would encourage discussing the design of the possible solution(s) here before attempting to raise a PR.
The text was updated successfully, but these errors were encountered: