-
Notifications
You must be signed in to change notification settings - Fork 131
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
fix: Add missing provider schema versions #1060
Conversation
ccf138c
to
5af48e8
Compare
e4c2ec3
to
37e172f
Compare
37e172f
to
0263915
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.
LGTM! Thanks for getting to the root cause
// sourced earlier where schema is yet to be sourced or sourcing failed. | ||
continue | ||
} | ||
if ps.Version == nil { |
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.
👍
This functionality has been released in v0.29.2 of the language server. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
This is a follow-up to a recent bug fix - #1048
The linked PR addressed the fact that we may sometimes get provider schemas with
nil
versions. This PR additionally ensures that versions are in fact stored as they should be and clarifies some related edge cases in attached comments.The temporary lack of versions for schemas is not as easily noticeable thanks to the loose/optimistic matching of schemas we perform, where even if we don't match the version, we always match based on the address, or even just provider name alone.
The only difference it makes is when there are two schemas for the same provider address of different versions - so that inaccuracy is being addressed.
terraform-ls/internal/state/provider_schema.go
Lines 264 to 333 in 0f745e1
Additionally - to make testing easier, I also added ranking of schemas based on version constraint match, further making schema matching more accurate.