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
Terraform supports a number of expressions (such as function calls, arithmetic operators, references etc.).
While expressions help users achieve and increase readability of their configurations they can make it harder to tell what exact value a complex expression will interpolate into, until plan phase.
decoder: Update PathDecoder.HoverAtPos()) such that it attaches evaluated expression value (if successful) to returned HoverData
terraform-ls
Update hcl-lang
Considerations for MVP
Initially we can consider just interpolation with context from within the configuration.
Later we can consider adding external sources, such as variables and state as reflecting these is likely going to involve more effort.
Blockers (upstream)
This is currently blocked as reimplementing whole interpolation logic within LS has quite high cost of maintenance cost and TF Core does not provide any way of doing interpolation on demand.
The best way would likely be some form of gRPC interface where TF Core acts as a gRPC server which LS can start on initialize and send arbitrary expressions for Core to evaluate and return back the result as gRPC response which can be reconstructed back into cty.Value on LS side. Such an interface doesn't exist yet and has not been RFC'd or planned in any level of detail yet.
The text was updated successfully, but these errors were encountered:
Use-cases
Terraform supports a number of expressions (such as function calls, arithmetic operators, references etc.).
While expressions help users achieve and increase readability of their configurations they can make it harder to tell what exact value a complex expression will interpolate into, until
plan
phase.For example
when hovering over
number_of_subnets
we could displaynumber_of_subnets number
length(aws_vpc.example) * 3
=9
in the hover popup and when hovering over
cidr_block
we could try to enumerate over the first few indexes and display e.g.cidr_block string
Proposal
hcl-lang
self.*
references inprovisioner
,connection
andlifecycle
blocks #859count.index
references in blocks w/count
#860each.*
references in blocks w/for_each
#861decoder
: UpdatePathDecoder.HoverAtPos()
) such that it attaches evaluated expression value (if successful) to returnedHoverData
terraform-ls
hcl-lang
Considerations for MVP
Initially we can consider just interpolation with context from within the configuration.
Later we can consider adding external sources, such as variables and state as reflecting these is likely going to involve more effort.
Blockers (upstream)
This is currently blocked as reimplementing whole interpolation logic within LS has quite high cost of maintenance cost and TF Core does not provide any way of doing interpolation on demand.
The best way would likely be some form of gRPC interface where TF Core acts as a gRPC server which LS can start on
initialize
and send arbitrary expressions for Core to evaluate and return back the result as gRPC response which can be reconstructed back intocty.Value
on LS side. Such an interface doesn't exist yet and has not been RFC'd or planned in any level of detail yet.The text was updated successfully, but these errors were encountered: