-
Notifications
You must be signed in to change notification settings - Fork 24
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
Consider exposing evaluated config as data to code lenses #132
Comments
Thanks @radeksimko for raising this issue. I'll try adding more context for our specific use case. With @infracost, we look up resource costs using queries/filters that we build from Terraform block attributes. Let's take a simple example using
We use the
With our Infracost VSCode extension, we then display the overall cost of the resource above the block as a code lens: When evaluating integration with At Infracost, we are working towards building an SDK with the potential that this would evolve into an LS. These features would allow us in the future to have a much more efficient and easy code lens integration. However, @radeksimko's suggestion to provide fully evaluated attributes to the code lens functions seems to be the most logical approach to this integration. Exposing evaluated attributes would mean that all the parsing and caching behaviour could live within To be clear, our requirements for this would be as follows:
|
Background
Code lens implementors can currently access
PathContext
.This contains evaluated resource & data source data types (
cty.Type
) underReferenceTargets
(reference.Targets).Based on feedback from @hugorut from @infracost, they would like to access evaluated data (at least evaluated as much as possible within the context, possibly with some unknowns), such that they can return cost estimations based on that data for each resource.
Proposal
Consider storing & exposing evaluated data in a format similar we use to store/expose types via
ReferenceTargets
.Side Notes
It is likely we will need this anyway for hashicorp/terraform-ls#495 and hashicorp/terraform-ls#956
The text was updated successfully, but these errors were encountered: