Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Markdown Terraform Code Block HighlightingNew to Visual Studio Code? Get it now.
Markdown Terraform Code Block Highlighting

Markdown Terraform Code Block Highlighting

Saverio Miroddi

|
1,180 installs
| (2) | Free
Highlights Terraform code blocks in the Markdown editor and preview. No additional extensions required.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Markdown Terraform Code Block Highlighting

Highlights tf and terraform fenced code blocks in the VS Code Markdown editor and built-in Markdown Preview. Fence names are case-insensitive; backticks and tildes are supported, including blocks in lists and blockquotes.

```tf
resource "aws_instance" "example" {
  ami = var.ami_id
}
```

The HashiCorp Terraform syntax grammar is bundled. No additional extensions are required. Preview highlighting uses bundled VS Code TextMate and Oniguruma components; nothing is downloaded at runtime. Requires desktop VS Code 1.141 or later; vscode.dev and github.dev are not supported.

This extension provides syntax highlighting in the editor and preview, without language-server features. It does not associate itself with standalone .tf files.

Development

Run npm ci and npm test to test editor highlighting and rendered preview HTML. Run npm run build before launching the extension with F5. Development dependencies are excluded from the extension package.

Credits

Based on Matt Bierner's Markdown grammar injection example. Bundled grammar sources and licenses are recorded in THIRD_PARTY_NOTICES.md.

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