Skip to content

Add markdown injection grammar for HCL fenced code blocks#190

Closed
kestred wants to merge 2 commits intohashicorp:mainfrom
kestred:feat/markdown-hcl-codeblock
Closed

Add markdown injection grammar for HCL fenced code blocks#190
kestred wants to merge 2 commits intohashicorp:mainfrom
kestred:feat/markdown-hcl-codeblock

Conversation

@kestred
Copy link
Copy Markdown

@kestred kestred commented Feb 1, 2026

Enable syntax highlighting for HCL code blocks in Markdown files (```hcl) via TextMate grammar injection. The injection grammar delegates to source.hcl for actual highlighting.

Consumers (e.g. vscode-hcl) can register this grammar with:

 {
    "scopeName": "markdown.hcl.codeblock",
    "path": "./syntaxes/hcl.markdown.tmLanguage.json",
    "injectTo": ["text.html.markdown"],
    "embeddedLanguages": {
       "meta.embedded.block.hcl": "hcl"
    }
 }

Blocks #190

Closes hashicorp/vscode-hcl#163

AI Disclosure

This MR was generated with the help of Claude Code.

If you'd like me to close it, I have no qualms doing so.
Thank you for your time.

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've documented the impact of any changes to security controls.
    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

Enable syntax highlighting for HCL code blocks in Markdown files
(```hcl) via TextMate grammar injection. The injection grammar
delegates to source.hcl for actual highlighting.

Consumers (e.g. vscode-hcl) can register this grammar with:
  {
    "scopeName": "markdown.hcl.codeblock",
    "path": "./syntaxes/hcl.markdown.tmLanguage.json",
    "injectTo": ["text.html.markdown"],
    "embeddedLanguages": {
      "meta.embedded.block.hcl": "hcl"
    }
  }

Closes hashicorp/vscode-hcl#163

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kestred kestred requested a review from a team as a code owner February 1, 2026 05:33
@hashicorp-cla-app
Copy link
Copy Markdown

hashicorp-cla-app bot commented Feb 1, 2026

CLA assistant check
All committers have signed the CLA.

@kestred kestred force-pushed the feat/markdown-hcl-codeblock branch from ebaf1a8 to a6fc8fa Compare February 1, 2026 05:35
Signed-off-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
@kestred kestred changed the title Add markdown injection grammar for HCL fenced code blocks draft: add markdown injection grammar for HCL fenced code blocks Feb 1, 2026
@kestred kestred changed the title draft: add markdown injection grammar for HCL fenced code blocks Add markdown injection grammar for HCL fenced code blocks Feb 1, 2026
@kestred kestred closed this by deleting the head repository Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support files with embedded HCL syntax (e.g. Markdown)

1 participant