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

Support conditional expressions (condition ? true : false) #528

Closed
radeksimko opened this issue May 20, 2021 · 2 comments
Closed

Support conditional expressions (condition ? true : false) #528

radeksimko opened this issue May 20, 2021 · 2 comments

Comments

@radeksimko
Copy link
Member

radeksimko commented May 20, 2021

Background

Terraform supports conditional expressions. For example:

var.a != "" ? var.a : "default-a"

The language server currently doesn't support these, which means that completion is not provided:

  • within the condition before or after the operator (such as !=), nor
  • within the truthy part (after ?), nor
  • within the falsey part (after :)

It also means that we don't report valid expressions (such as traversals) anywhere within the conditional.

Proposal

Completion

TODO

Hover

Support the expression so that value can be interpolated as part of #495 and hover works for the expressions within a conditional. i.e. for var.a or "default-a in the following example

var.a != "" ? var.a : "default-a"

Semantic Tokens

TODO

@radeksimko
Copy link
Member Author

This was implemented in hashicorp/hcl-lang#326 with some follow-up issues linked from there.

@xiehan xiehan removed this from the v0.33.0 (tentative) milestone Jan 22, 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 Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants