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

Add function descriptions #32453

Merged
merged 5 commits into from
Jan 16, 2023
Merged

Conversation

dbanck
Copy link
Member

@dbanck dbanck commented Jan 4, 2023

This PR adds descriptions for all Terraform functions and is the first step in enabling machine-readable function signatures (more: TF-508: Machine-readable function signatures).

It is planned to export the descriptions via a new terraform metadata functions --json command. The first consumer of the JSON output will be the Terraform language server, to provide function signature information inside the editor. After that, the docs website might be another potential consumer, making the description list the single source of truth.

Instead of iterating over the functions list and using WithDescription for each one, I've another approach, referring to description entries from a function definition. But that approach requires edits in multiple places and matching slice indices when one wants to add a parameter description.

Target Release

1.4.x

@dbanck dbanck requested a review from kmoe January 4, 2023 11:18
Copy link
Member

@kmoe kmoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

internal/lang/functions_descriptions_test.go Outdated Show resolved Hide resolved
internal/lang/funcs/descriptions.go Outdated Show resolved Hide resolved
internal/lang/funcs/descriptions.go Outdated Show resolved Hide resolved
@dbanck dbanck marked this pull request as ready for review January 9, 2023 13:21
@kmoe kmoe merged commit 4fd8322 into hashicorp:main Jan 16, 2023
@github-actions
Copy link

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@dbanck dbanck deleted the f-add-function-descriptions-v2 branch January 16, 2023 10:57
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants