-
Notifications
You must be signed in to change notification settings - Fork 24
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 count and count.index completion in blocks #134
Conversation
34b8c93
to
f5f3f14
Compare
ba4f9d6
to
aaf1fa8
Compare
aaf1fa8
to
3406e0c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick review from my side: LGTM so far, just minor suggestions.
I think we should copy the BodySchema extensions when merging dependent body schemas as well. To be sure to cover every edge-case.
Lines 75 to 77 in 3406e0c
mergedSchema.Targets = depSchema.Targets.Copy() | |
mergedSchema.DocsLink = depSchema.DocsLink.Copy() | |
} |
mergedSchema.Extensions = depSchema.Extensions.Copy()
575c954
to
2b2b977
Compare
This provides completion hints inside blocks for `count.index` references within resource, data and module blocks anywhere the `count` meta-argument is supported. It detects if count is used already and does not suggest duplicates.
f0987e8
to
998e3b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good and functional - just needs some cleanup - I left some comments in-line.
Co-authored-by: Radek Simko <radek.simko@gmail.com>
Co-authored-by: Radek Simko <radek.simko@gmail.com>
Co-authored-by: Radek Simko <radek.simko@gmail.com>
af583b2
to
533e459
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some error handling suggestions & a test.
Co-authored-by: Radek Simko <radek.simko@gmail.com>
Feedback is added and test is added! |
In hashicorp/hcl-lang#134 we now pass the context down to the decoder if using Hover or SemanticTokens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest test LGTM!
In hashicorp/hcl-lang#134 we now pass the context down to the decoder if using Hover or SemanticTokens. Updated hcl-lang and terraform-schema references.
In hashicorp/hcl-lang#134 we now pass the context down to the decoder if using Hover or SemanticTokens. Updated hcl-lang and terraform-schema references.
This provides completion hints inside blocks for
count.index
references within resource, data and module blocks anywhere thecount
meta-argument is supported. It detects if count is used already and does not suggest duplicates.Closes hashicorp/terraform-ls#860