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

Make references scope & type aware #582

Merged
merged 1 commit into from
Jul 8, 2021
Merged

Make references scope & type aware #582

merged 1 commit into from
Jul 8, 2021

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Jul 8, 2021

Previously reference origins/addresses (such as var.foo) would be matched against addressable targets (attributes or blocks) in a strict fashion where addresses have to match exactly.

This patch makes origins scope & type aware as per hashicorp/hcl-lang#68 which in turn helps us "optimistically" recognize references to targets of unknown type.

Before

References to var.test are not recognized (no data provided on hover, reference not semantically highlighted, no go-to-definition etc.) due to the variable not having explicit type.

Screenshot 2021-07-08 at 10 48 29

After

Screenshot 2021-07-08 at 10 49 01

On hover we display the closest known target (for clarity).

Screenshot 2021-07-08 at 10 49 34

2021-07-08 10 49 50

@radeksimko radeksimko force-pushed the f-type-aware-refs branch from 416cf4c to 5f5adce Compare July 8, 2021 09:57
@radeksimko radeksimko marked this pull request as ready for review July 8, 2021 09:57
@radeksimko radeksimko merged commit 7c755bc into main Jul 8, 2021
@radeksimko radeksimko deleted the f-type-aware-refs branch July 8, 2021 10:09
@radeksimko radeksimko added this to the v0.19 milestone Jul 8, 2021
@github-actions
Copy link

github-actions bot commented Aug 8, 2021

I'm going to lock this pull request 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 related to this change, 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 Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant