You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in hashicorp/terraform-ls#563 it would be helpful for users to have on-type and/or on-save diagnostics based on the schema.
In Terraform specifically this can be achieved via terraform validate, but that comes with a trade-off in the form of loading all plugins and gRPC chattery with all of them to validate the whole configuration.
While the decoder will never be able to run ValidateFuncs declared within providers, it has most of the other context in the form of schema and so it can do most of the early validation on its own.
Before doing anything beyond the basics above in Terraform specifically we may want to address hashicorp/vscode-terraform#715 + hashicorp/terraform-ls#193 to generally be sure the schema can represent the reality accurately and we can avoid publishing false diagnostics just because we don't have accurate schema.
Proposal
Introduce a Validate method in the hcl-lang decoder package that iterates over the module files
Nitpick: I think the second method being proposed should probably be called validateBodyPerSchema given that the argument is no longer a whole file, but just AST body.
As mentioned in hashicorp/terraform-ls#563 it would be helpful for users to have on-type and/or on-save diagnostics based on the schema.
In Terraform specifically this can be achieved via
terraform validate
, but that comes with a trade-off in the form of loading all plugins and gRPC chattery with all of them to validate the whole configuration.While the decoder will never be able to run
ValidateFunc
s declared within providers, it has most of the other context in the form of schema and so it can do most of the early validation on its own.Known High-Value Use Cases
resource "" "name" {
)Before doing anything beyond the basics above in Terraform specifically we may want to address hashicorp/vscode-terraform#715 + hashicorp/terraform-ls#193 to generally be sure the schema can represent the reality accurately and we can avoid publishing false diagnostics just because we don't have accurate schema.
Proposal
Validate
method in the hcl-lang decoder package that iterates over the module filesValidateFile
method in the hcl-lang decoder packagePathDecoder
Part of hashicorp/vscode-terraform#720
The text was updated successfully, but these errors were encountered: