-
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
Completion of module variables in module block #93
Comments
Hi @pecigonzalo i.e. what do you mean by "completion from modules"? There is a few aspects of modules where completion comes to mind:
|
Unfortunately no and I was not really good at describing it initially, ill give it a look tomorrow and try to repro. Im assuming this is becoming more active now that Hashi is adopting the VSCode Terraform extension as well, that is great news as I was about to try to implement this. |
@radeksimko I got around to remember what this was about. As we use tons of modules, we wanted to be able to autocomplete module outputs when typing them. Lets say I have module for a vpc like resource "aws_vpc" "default" {
[...]
}
output "vpc_id" {
value = "${aws_vpc.default.id}"
description = "The VPC ID"
} and some code like module "vpc" {
[...]
}
output "id" {
value = module.vpc.vpc_id
} When typing |
@pecigonzalo Understood - that's another valid case I forgot to mention above. 👍 I think this would generally fall under #38 which will come after #36 as we need to teach the parser how to parse module outputs first. |
Probably dependent upon this upstream issue: hashicorp/terraform-config-inspect#24 |
Does this request for autocompletion of module outputs also extend to attributes of those outputs? For when they are complex objects, such as entire resources? E.g.
|
FYI: We have just released Completion for variables is yet to come and outputs fall under a slightly bigger task of supporting expressions which is tracked under hashicorp/hcl-lang#2 |
If it's helpful (probably depends how long the follow up takes), one of my coworkers wrote a vscode extension which adds autocomplete for module variables and outputs: https://github.com/mgtrrz/terraform-completer |
This was implemented as part of #551 and released in Further improvements are planned in this area and I'd recommend reviewing the list and/or subscribing to this meta issue if you are interested: hashicorp/vscode-terraform#715 Pre-filling required (module) attributes is also tracked under hashicorp/vscode-terraform#719 |
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. |
I could not find any issues or references to it, but does autocompletion work from modules? We use a lot of them, and it does not seem to work for us.
The text was updated successfully, but these errors were encountered: