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 for references to variables and locals #491

Closed
radeksimko opened this issue May 6, 2021 · 1 comment · Fixed by #553
Closed

Support for references to variables and locals #491

radeksimko opened this issue May 6, 2021 · 1 comment · Fixed by #553
Labels
enhancement New feature or request release-blocking planned release will not ship without this textDocument/completion textDocument/hover textDocument/semanticTokens Semantic syntax highlighting
Milestone

Comments

@radeksimko
Copy link
Member

radeksimko commented May 6, 2021

Background

As part of initial work on supporting traversal expressions (references such as aws_instance.example.public_ip) it was decided to leave out variables, locals and outputs as the data types are not statically defined in the schema for these.

Use-cases

Completion

Given a config

variable "test" {
  type = number
}

locals {
  foo = 42
}

resource "aws_lb" "example" {
  listener {
    port = # <- HERE
  }
}

user should be able to auto-complete var.test or local.foo for port field (assuming port is of number type).

Hover

Given a config

resource "aws_lb" "example" {
  listener {
    port = var.test
    protocol = local.protocol
  }
}

a popup should appear once user hovers over var.test or local.protocol with data type (e.g. string or number).

Semantic Tokens

Given a config

resource "aws_lb" "example" {
  listener {
    port = var.test
    protocol = local.protocol
  }
}

both var.test and local.protocol should be highlighted correctly via semantic tokens.

Proposal

@github-actions
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 Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request release-blocking planned release will not ship without this textDocument/completion textDocument/hover textDocument/semanticTokens Semantic syntax highlighting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants