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

reference: refactor & fix matching of cyclical refs #159

Merged
merged 2 commits into from
Nov 22, 2022

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Nov 21, 2022

This introduces some minor changes to the interfaces, to plumb context through, in preparation for using it to pass down context, such as whether "SelfRefs" is active, i.e. whether self.* addresses are relevant in that context.

Additionally, the matching logic is being refactored and updated to account for cyclical references, specifically to continue rejecting completion such as

resource "aws_instance" "test" {
  count = 4

  cpu_core_count = aws_instance.test.cpu_core_count
}

TODO: Address hover & semtok highlighting which still recognize the above as valid ^

and

resource "aws_instance" "test" {
  count = count.index
}

and (future)

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

@radeksimko radeksimko force-pushed the b-fix-ref-matching-logic branch from f25632f to b56bbef Compare November 21, 2022 16:18
@radeksimko radeksimko marked this pull request as ready for review November 21, 2022 16:20
@radeksimko radeksimko requested a review from a team November 21, 2022 16:20
@radeksimko radeksimko force-pushed the b-fix-ref-matching-logic branch from b56bbef to ac45ab4 Compare November 21, 2022 16:33
@radeksimko radeksimko added the bug Something isn't working label Nov 21, 2022
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for extracting this

decoder/expression_candidates.go Outdated Show resolved Hide resolved
@radeksimko radeksimko merged commit 0f2e32b into main Nov 22, 2022
@radeksimko radeksimko deleted the b-fix-ref-matching-logic branch November 22, 2022 10:53
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.

2 participants