-
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
Maintain global provider schema cache #354
Comments
This comment has been minimized.
This comment has been minimized.
Does this fix the "No schema found for "abc/xyz/def". Functionality may be limited. You may need to run terraform init." in Vscode. If yes, please describe what changes to do in settings.json. |
@satish-chef This patch has not been shipped yet - we plan to ship it this week or beginning of the next one and VS Code users will receive the update automatically. Thank you for your patience. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Past/Current Situation
Currently (v0.11.0) we obtain provider schemas via the CLI (
terraform providers schema -json
) and track it for each module individually. This is suboptimal especially in cases of more root modules with duplicate provider versions as we store the same data more than once. More importantly we have no way of cross-referencing and reusing the data.LS assumes that there's a single source of truth for the schema, when sources could in reality be combined.
Global tracking was initially avoided, because of the limited ways of identifying a provider (there was no concept of provider "address" until Terraform 0.13) and because the first architecture of LS didn't account for the complexity of module nesting nor it parsed provider requirements nor had capability to detect installed provider versions.
We have gathered feedback from GitHub and VS Code Marketplace in the past months where users were confused by various warnings we issue which can be attributed in one way or another to lack or inaccuracy of provider schema and practically very limited functionality of the language server.
We started pre-baking some schemas to address this, which provided at least some data to these users, but the solution is generally very naive (which is not a criticism, but a chosen trade-off) and it's becoming clear that we'll need a more flexible solution, especially once we start pulling schemas from more sources per #193 and #355
Proposal
We now (since 0.13 was released) have a mechanism for identifying providers, whether they are installed locally or come from a Registry (via an address).
It seems natural to therefore allow combining provider schemas, which we do to a limited degree already by falling back to preloaded schemas.
Here is what will likely need to be done:
registry.terraform.io/hashicorp/azurerm
)2.40.0
)terraform providers schema -json
ran, or preloaded JSON export)Alternative root modules found
warning and log this internally insteadNo root modules found
warning and log this internally insteadThe text was updated successfully, but these errors were encountered: