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

meta: Support all Terraform expression types #641

Open
radeksimko opened this issue May 20, 2021 · 3 comments
Open

meta: Support all Terraform expression types #641

radeksimko opened this issue May 20, 2021 · 3 comments
Labels
enhancement New feature or request meta

Comments

@radeksimko
Copy link
Member

radeksimko commented May 20, 2021

Problem Statement

Terraform supports many different expressions via HCL. Some expressions might be more commonly used (e.g. static strings, numbers, booleans, scoped references...) and some less.

Users expect an LS-supported editor such as VS Code extension to provide them completion or hover and highlight arbitrarily complex and nested valid expressions.

Technical Details

The following HCL expressions are already supported in some form or shape:

The following are not yet supported:

User Impact

Pretty much all users would benefit from this, some expressions may only be used by more advanced users, but supporting all expressions is pre-requisite for being able to fully and reliably evaluate any expression.

Expected User Experience

Completion

User is provided with relevant completion for and inside any expression.

For example:

  • User is able to complete function names, i.e. attr = HERE
  • User is able to complete relevant references as arguments to function calls, i.e. attr = max( HERE )
  • User is able to complete references within a template, i.e. "${ HERE }"
  • User is able to complete references alongside operators, i.e. attr = 3 + HERE
  • etc.

Hover

User can see details about any expression on hover

For example:

  • attr = max(1, 3) when hovered over max signature of the function and description comes up
  • attr = "hello ${var.person}" when hovered over var.person, type and description of the variable comes up
  • etc.

Semantic Highlighting

All expressions are represented as highlightable tokens where appropriate.

For example:

  • max(1, 3) - max is reported as function call
  • type = list(string) - list and string is reported as type declarations
  • "hello ${var.person}" - "hello is reported as string and var & person as traversal steps
  • etc.

Proposal

@gdsotirov

This comment was marked as off-topic.

@radeksimko

This comment was marked as off-topic.

@gdsotirov

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request meta
Projects
None yet
Development

No branches or pull requests

4 participants