Backfill standard library function & parameter descriptions #136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR backfills all the descriptions for functions and parameters used by Terraform.
Background
To be able to offer auto-completion of available functions and their signatures within the Terraform language server, we need a longer description for both a function and each parameter.
More information is available in the TF-418: Support Functions in Language Server RFC.
Changes
I've added a description to all function definitions, and their parameters that Terraform is currently using. The function description is a direct copy of the documentation's first paragraph. I mostly made up the parameter descriptions based on text snippets. It might make sense to have a technical writer make sure those provide the right context.
gofmt
made some changes to a few larger comments.UX
This is how the descriptions appear in VS Code.
Auto-completion of functions
The function signature is displayed to the right and below that the description.
Signature help for a function
The parameter descriptions (1) appears below the function signature and the function description (2) below that.
On hover over a function
The function description is displayed below the signature.
Misc
I don't know if it's helpful to others, but I've created a list of all Terraform functions, their introduction, and their source to track the work.