Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Nifty HCL Tools: .tf and .hcl Language SupportNew to Visual Studio Code? Get it now.
Nifty HCL Tools: .tf and .hcl Language Support

Nifty HCL Tools: .tf and .hcl Language Support

Nifty

|
68 installs
| (0) | Free
Fast, lightweight Terraform and OpenTofu support: highlighting, outline, go to definition and references across a module, hovers, completion, undefined-reference errors and formatting.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Nifty HCL Tools

Fast, lightweight Terraform and OpenTofu support: highlighting, outline, go to definition and references across a module, hovers, completion, undefined-reference errors and formatting.

Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.

Features

Hover on var.instance_type: its type, default and description, with reference counts above each block

A misspelled variable flagged before tofu plan: No variable var.alert_emial in this module

Find All References from a variable declaration

  • Fast and light. No language server to download and nothing running in the background, so it opens instantly even in large repos. Works with Terraform and OpenTofu (.tf, .tofu, .tfvars) and plain .hcl files.
  • Highlighting for blocks, labels, attributes, functions, references, strings with ${…} interpolation and heredocs.
  • Go to Definition across the module. Ctrl+click var.region, local.name, module.network, data.aws_iam_policy_document.read or aws_s3_bucket.logs to jump to its declaration, in whichever .tf file of the folder it lives.
  • Find All References from a variable, resource, data source, module or local, with a reference count above each block. Unused variables stand out at "0 references".
  • Hover over var.x for its type, default and description, over local.x for its value, and over a resource, data source or module for its declaration and source.
  • Completion after var., local., module., data. and a resource type, from the module's own declarations.
  • Undefined references are marked as errors (No variable var.missing in this module.) as you type, before you run plan.
  • Outline and breadcrumbs list every block, with locals entries nested.
  • Format Document runs tofu fmt or terraform fmt if one is on your PATH, or the program you set.
  • Works in the browser on vscode.dev and github.dev; formatting with tofu fmt or terraform fmt needs the desktop app.

Settings

Setting Default What it does
nifty.hcl.validateReferences true Report references to variables, locals, modules, data sources and resources that don't exist
nifty.hcl.referenceCodeLens true Show reference counts above blocks
nifty.hcl.formatter auto auto (tofu, then terraform), tofu, terraform, or a full path

A module is the set of .tf files in one folder, as in Terraform itself. Provider schemas (resource attribute names) aren't included. For those, use this alongside the official extension, or on its own when you want speed.

Terraform is a trademark of HashiCorp. This extension isn't affiliated with or endorsed by HashiCorp or the OpenTofu project.

Install

  • VS Code: search for "Nifty HCL Tools" in the Extensions view, or install from the Visual Studio Marketplace.
  • Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.

Privacy

This extension collects no telemetry and needs no account.

More Nifty tools

  • Nifty Java Quality: Format, Checkstyle & PMD: Format Java with google-java-format or palantir-java-format, and see Checkstyle and PMD problems as you save. Tools download from Maven Central when you say so; zero setup for Maven and Gradle. (Open VSX)
  • Nifty Nginx: nginx.conf Formatting & IntelliSense: nginx config support: syntax highlighting, formatting, directive completion and docs on hover, context checks, and snippets for reverse proxies, SSL and PHP. (Open VSX)
  • Nifty PHP Quality: PHPStan, PHPCS & Pint: PHPStan, PHP_CodeSniffer, Laravel Pint and PHP-CS-Fixer in one extension: problems as you save, one Fix command, and zero setup when the tools are in your project's vendor/bin. (Open VSX)
  • Nifty Shaders: GLSL, HLSL & WGSL Checks: GLSL, HLSL and WGSL: syntax colours, errors from glslangValidator and naga (bundled for WGSL, works on the web), #include links, hover docs, completion and outline. (Open VSX)
  • Nifty Shell Format: shfmt Formatter for Bash: Format shell scripts (bash, sh, zsh, bats) with shfmt built in: no binary to install, reads .editorconfig, and shows syntax errors. (Open VSX)
  • Nifty TOML: Format, Validate & Schemas: TOML support: highlighting, errors, a formatter that keeps comments, outline, folding, and JSON Schema validation, completion and hover (Cargo.toml, pyproject.toml via SchemaStore). TOML to JSON/YAML. (Open VSX)

See all 100+ Nifty extensions and web tools at https://getnifty.dev

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft