-
Notifications
You must be signed in to change notification settings - Fork 640
Add function inspections #676
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
base: main
Are you sure you want to change the base?
Conversation
Hi @apparentlymart, would you be able to take a look at this? It looks like you have done most of the reviews on function related features. |
sry. I made a mistake. IDK how to dismiss my approval🤣 |
@jbardin @liamcervante, could I get some eyes on this? |
Thanks for the contribution @cam72cam! I should be able to take a look at this soon. |
@jbardin any updates on having time to review this? |
Some belated commentary on this after I've got some relevant context loaded into my brain for other reasons:
I dunno if maintainers are even still interested in this functionality at this point, but I share this just in case it's helpful! Footnotes
|
With the focus on functions in recent hcl releases, I thought it time to introduce the ability to inspect which functions are required to evaluate expressions. This mirrors the Variable traversal present throughout the codebase.
This allows for better error messages and optimizations to be built around supplying custom functions by consumers of HCL.
These changes are backwards compatible and is not a breaking change. I explicitly introduced hcl.ExpressionWithFunctions to allow consumers to opt-into supporting function inspection. I would recommend that this be moved into hcl.Expression if a major version with API changes is ever considered.