-
Notifications
You must be signed in to change notification settings - Fork 179
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
Support for built-in functions #666
Comments
radeksimko
added
the
terraform-ls
Features/bugs which will be implemented/fixed purely on the LS side
label
Jun 18, 2021
danieldreier
removed
enhancement
New feature or request
terraform-ls
Features/bugs which will be implemented/fixed purely on the LS side
upstream/tf-core
labels
Jul 27, 2021
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Related to
Problem Statement
Terraform provides builtin functions to help users build reusable configuration.
Without consulting the documentation users may not always know:
Technical Details
Functions are considered to be expression types within HCL and each version of Terraform may contain different functions or the implementation of functions may differ.
User Impact
Any user which uses functions in their configuration would be impacted.
Expected User Experience
User will be guided to get names of functions, arguments and outputs right, and understand what a function does without leaving their editor.
Completion
Given a configuration
when user requests completion in the highlighted position, aside from other candidates (such as references), they're presented with function names compatible with the field type (i.e. functions which return string in the above example as
cidr_block
is of type string):Hover
When user hovers over
format
they're provided with a description of the function, such as:Semantic highlighting
The name of a valid function, such as
format
will be highlighted semantically as function name, name of an invalid function (such asfrmt
) will not. That way user can tell a difference between typo-ed function name and correct one just from the colours.Function signature
After picking function name from completion popup, or typing a "trigger character"
(
user is presented with function signature. They're also presented with details relevant to an argument relevant to the position after typing (or completing) "trigger character",
.The user-visible content presented is similar to the one presented via hover, except that here we also document each parameter individually, i.e.
The specification is a string that includes formatting verbs that are introduced with the % character.
Values to be formatted per specification
Proposal
hcl-lang
to allow registering function signatures, or whole functions (depending on implementation)terraform-schema
to provide function signatures, or whole functionsBlocking Questions
The text was updated successfully, but these errors were encountered: