Enhanced editor validation makes resolving errors easier

Announced yesterday at HashiConf:

When writing Terraform code, either by hand or by leveraging the latest generative AI tools, errors are a fact of life. That means developers often find themselves context switching between their editor and the CLI to validate code, leading to frustration and reducing productivity.

Enhanced editor validation in the Terraform extension for Visual Studio Code automatically validates Terraform code as early as possible, creating an enhanced, integrated authoring experience by highlighting errors and providing guidance to help resolve issues quickly. Examples of these new validations include:

  • Identifying missing variable declarations or required attributes
  • Highlighting unexpected attributes or blocks
  • Issuing warnings for deprecated attributes.

Not mentioned in the blog post is the fact that this feature was added to the Terraform language server, which means it can be used in any LSP-compatible editor, including SublimeText, Vim / NeoVim, and Emacs in addition to the official Terraform VS Code extension.

If you’ve tried out the new enhanced validation feature, whether to validate the Terraform configuration produced by an LLM like ChatGPT or the code that you’re writing by hand, please let us know what you think! Our team is always open to feedback on how to improve the experience of authoring Terraform configuration in our editors.

1 Like