Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dbanck opened this issue Nov 4, 2022 · 1 comment
Open

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

dbanck opened this issue Nov 4, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@dbanck
Copy link
Member

dbanck commented Nov 4, 2022

Background

VS Code mostly makes the assumption that each file has a single language and based on that language it decides whether to

  • highlight the file using a particular grammar
  • send the file to the language server, to provide IntelliSense (e.g. completion or hover) for it

There are files which may embed HCL syntax in some ways, e.g. Markdown via code blocks such as ```hcl

Proposal

Enable syntax highlighting for Markdown files via grammar injection, e.g.

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

Related links

@dbanck dbanck added the enhancement New feature or request label Nov 4, 2022
@FlorinAndrei
Copy link

This would be very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants