You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0.17 (future version which will have basic reference support)
Context
References in HCL/Terraform have steps separated by . or brackets []. As part of initial work on reference completion, references (including those special characters) are treated as opaque strings. For example when user requests completion in the following config
resource"aws_instance""example" {
# ...
}
output"foo" {
value=# HERE
}
they are presented with all known attributes of aws_instance.example (and any other resources and data sources declared in the config), e.g.
This could be overwhelming in larger configurations.
Use-cases
While I believe this can be valuable, I'm not sure yet how to best surface it to the users yet.
Step-based only completion
Provide user with just the first known reference step i.e. up to the first . or [ and treat . and [ as completion trigger characters in that context.
Using the example config above, user would only be presented with aws_instance.example (ignoring the builtin references such as terraform.workspace). Then once they confirm the option, they'll be presented with next steps, e.g. credit_specification, once they confirm and are presented with cpu_credits.
Step-based completion prioritized
Some users might like both fully expanded references and the above step-based completion. We could provide both and prioritize "parent" references in the list.
Using the example config above, user would be presented with the following candidates in that exact order
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.
Current Version
Context
References in HCL/Terraform have steps separated by
.
or brackets[
]
. As part of initial work on reference completion, references (including those special characters) are treated as opaque strings. For example when user requests completion in the following configthey are presented with all known attributes of
aws_instance.example
(and any other resources and data sources declared in the config), e.g.This could be overwhelming in larger configurations.
Use-cases
While I believe this can be valuable, I'm not sure yet how to best surface it to the users yet.
Step-based only completion
Provide user with just the first known reference step i.e. up to the first
.
or[
and treat.
and[
as completion trigger characters in that context.Using the example config above, user would only be presented with
aws_instance.example
(ignoring the builtin references such asterraform.workspace
). Then once they confirm the option, they'll be presented with next steps, e.g.credit_specification
, once they confirm and are presented withcpu_credits
.Step-based completion prioritized
Some users might like both fully expanded references and the above step-based completion. We could provide both and prioritize "parent" references in the list.
Using the example config above, user would be presented with the following candidates in that exact order
i.e.
aws_instance.example
is first on the list.Proposal
TODO
The text was updated successfully, but these errors were encountered: