-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Labels
Description
Background
The locals block is somewhat unique compared to the rest of the language in that it has cty.DynamicPseudoType constraint, i.e. any type and allows interpolation.
We currently provide very basic completion inside of locals right after the = which brings up all functions and references.
We do not provide completion in many other contexts which may be relevant
- boolean (
true/false) - maps (+ inside keys and values)
- objects (+ inside attribute names and values)
- tuples (+ elements)
- lists (+ elements)
- sets (+ elements)
Proposal
- Enable completion for boolean, i.e.
trueandfalse - Enable completion for new objects, i.e.
{ ... } - Enable completion inside object attribute names, i.e.
{ (HERE) = "foo" } - Enable completion inside object attribute values, i.e.
{ foo = HERE } - Enable completion for new maps, i.e.
tomap({ ... }) - Enable completion inside map keys, i.e.
{ (HERE) = "foo" } - Enable completion inside map values, i.e.
{ foo = HERE } - Enable completion for new tuples, i.e.
[ ... ] - Enable completion inside tuples, i.e.
[ HERE, HERE, ... ] - Enable completion for new sets, i.e.
toset([ ... ]) - Enable completion inside sets, i.e.
toset([ HERE, HERE, ... ]) - Enable completion for new lists, i.e.
tolist([ ... ]) - Enable completion inside lists, i.e.
tolist([ HERE, HERE, ... ])
Implementation Notes
This can be more broadly described as completion inside of an attribute with the following constraint:
schema.AnyExpression{
OfType: cty.DynamicPseudoType,
}i.e. this is relevant for any other language and other parts of the Terraform language which may satisfy the above, not just locals.
