-
Notifications
You must be signed in to change notification settings - Fork 132
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
Language server uses an ambiguous provider version when multiple .terraform environments exist #1664
Comments
Hi @seanhoughton, Thanks for the report! I think I need more details to reproduce the problem. I assume you ended up with multiple versions of the same provider through upgrades? Internally, the language server uses |
Thanks for the additional details! We have two sources for provider schemas:
The latter should always be preferred over the bundled one, as it is a better match to the provider version in use. The language server build
Are there other |
I'm using the 32.8 language server, but I think I figured it out. I'm using three different environments in the project. All of the environments share a set of modules but each have their own I'm not sure what the fix should be. It could be a workspace configuration setting similar to the "select the python virtual environment" option in the Python extension. Ultimately all the environments should be on the same version so I have resolved this by ensuring all environments are on the same provider revisions.
|
I am experiencing this issue and my situation is simpler than @seanhoughton's. I am using terraform-ls version 0.34.3, with the vercel provider version 1.14.1. I've upgraded this from using The specific error I'm getting is that the lsp thinks the
|
Language Server Version
v0.32.8
Terraform Version
Terraform v1.7.3 on darwin_arm64
Client Version
VSCode 1.87.2
Terraform Configuration
Steps to Reproduce
Alternatively, just hover over the provider to see the incorrect version number
Expected Behavior
The language server should use the version of the provider set in the
.terraform.lock.hcl
or consider version constraints in therequired_providers
block.Actual Behavior
The language server appears to pick a consistent (but sometimes incorrect) version from the ones that are installed.
Gist
No response
Workarounds
Delete all old versions of the provider from the
.terraform/providers
folderReferences
No response
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: