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

Avoid reporting cyclical references in hover/semtok/go-to-* #161

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

radeksimko
Copy link
Member

Currently, the reference in the configuration below is treated as valid in the context of hover, semantic token highlighting and go-to-definition/go-to-references, even though it's not a valid reference.

resource "aws_instance" "test" {
  ami = aws_instance.test.ami
}

@radeksimko radeksimko added the bug Something isn't working label Nov 22, 2022
@radeksimko
Copy link
Member Author

There is some logic handling address resolution which we could share between target and origin collection, but it would need to be refactored (out).

I think ideally, we should end up with 1 or more functions which walk the AST (hcl.Body) & schema, and keep track of the address in any given context - in case of targets we'd just collect the address and append it to the slice, in case of origin we'd compare it with the traversal for equality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant