Skip to content
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

Provider-defined functions support #1674

Closed
11 tasks done
dbanck opened this issue Jan 22, 2024 · 3 comments
Closed
11 tasks done

Provider-defined functions support #1674

dbanck opened this issue Jan 22, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request meta

Comments

@dbanck
Copy link
Member

dbanck commented Jan 22, 2024

Background

Terraform will introduce provider-defined functions in an upcoming release. This will allow provider authors to ship their own functions. Practitioners will be able to use them in their Terraform configuration using a new function call syntax: provider::aws::noop().

We currently support all built-in core functions as static definitions in terraform-schema. The provider functions will be part of the provider schema JSON and should be parsed whenever we get a provider schema (bundled or via CLI). Both need to be merged into a single list of function signatures.

Expected User Experience

Syntax highlighting, completion, hover, semantic tokens, and signature help are working as expected for provider-defined functions.

completion

signature help

Proposal

hcl

hcl-lang

terraform-json

terraform-schema

terraform-ls

syntax


Stretch Goals

@ansgarm
Copy link
Member

ansgarm commented Feb 22, 2024

Posting my findings about the earlydecoder output stuff that is causing nil panics here:
The value of outputs seems to indeed be used, well to be precise, its type is:
https://github.com/hashicorp/terraform-schema/blob/0c03703f91f7085f9f2910e7e79f214c9f913ad0/schema/module_schema.go#L159

The value itself is also stored in a map, but that one is never read.

So, I don't think we can remove the handling there, but we can ignore nil expressions.

@dbanck
Copy link
Member Author

dbanck commented Apr 11, 2024

Shipped 🎉

@dbanck dbanck closed this as completed Apr 11, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request meta
Projects
None yet
Development

No branches or pull requests

2 participants