hashicorp / vscode-terraform

HashiCorp Terraform VSCode extension
https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform
Mozilla Public License 2.0
920 stars 179 forks source link

Syntax Highlighting tied to version constraints in local workspace. #1842

Open plieberg opened 2 weeks ago

plieberg commented 2 weeks ago

Extension Version

v2.32.3

Problem Statement

Syntax highlighting and validation are great, but it appears to always assume the latest version of the provider. In my case, the azurerm provider, which recently released v4.x. We are not ready (haven't had time) to upgrade all of our modules to this version and it is now highlighting invalid options on certain resources for v4 of the provider when we are running v3 and those options are still valid.

Expected User Experience

It would be nice to tie the syntax highlighting and validation to the version constraint specified in the current workspace.

Proposal

Check the local workspace/folder for version constraints and adjust syntax highlighting and validation to match the latest version of the provider allowed by those constraints.

References

No response

Help Wanted

Community Note

plieberg commented 2 weeks ago

Another option would be to allow the user to set version constraints in the plug-in settings.