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

Add Support for traversal expressions #2

Closed
radeksimko opened this issue Nov 10, 2020 · 0 comments · Fixed by #36
Closed

Add Support for traversal expressions #2

radeksimko opened this issue Nov 10, 2020 · 0 comments · Fixed by #36
Assignees

Comments

@radeksimko
Copy link
Member

radeksimko commented Nov 10, 2020

The decoder currently can't provide any LSP functionality related to expressions.

For example in Terraform:

data "aws_ami" "ubuntu" {
  most_recent = true

  filter {
    name   = "name"
    values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
  }

  filter {
    name   = "virtualization-type"
    values = ["hvm"]
  }

  owners = ["099720109477"] # Canonical
}

resource "aws_instance" "web" {
  ami           = HERE # <---
  instance_type = "t3.micro"
}

Currently all we "prefill" for ami is a static "value", but the data block's attributes above can be referred to as data.aws_ami.ubuntu.attr_name.

The schema will need to know how blocks/attributes are referenced to and be able to lookup references of a particular type, so that we can e.g. offer data.aws_ami.ubuntu.id (knowing it refers to a string) for ami (string) field.

Also references can be type-less and in such case we may need to filter references based on the "namespace", e.g.

provider "aws" {
  alias = "uswest"
}

resource "aws_instance" "web" {
  provider = HERE # <--
}
@radeksimko radeksimko self-assigned this Nov 12, 2020
@radeksimko radeksimko changed the title Add Support for Expressions Add Support for traversal expressions Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant