How to tell vscode that *.heex is a HTML file

VSCode has built in support for HTML files. When you open <div> it automatically brings in </div>. Matching colors and there are several other good features for a native HTML file. However, when the file is heex extension, all these features are lost. How do we tell vscode to consider the contents of heex file as regular HTML encoding?

Hi! i have this line in my settings of VSCode
~/Library/Application Support/Code/User/settings.json

  "files.associations": {
    "*.eex": "eex",
    "*.heex": "html-eex"

I hope it is functional for you :slight_smile:

1 Like
 "files.associations": {
    "*.heex": "phoenix-heex",

is what I have. But, I think it is not sufficient. It is being considered as html file - but - I am unable to get "html.autoClosingTags": true, to work.
Maybe the elixir-ls extension which handles phoenix-heex file has to do something. I do not know.

a okok, i also have installed this extension ElixirLS: Elixir support and debugger - Visual Studio Marketplace and i have this line in my settings.json

"emmet.includeLanguages": {
  "html-eex": "html"
1 Like

I also have the setting. It is only for enabling Emmet in the files. Something like div*2>p etc. HTML Programming with Visual Studio Code - if you observe the features of intellisense, close tags, auto update tags are not working in our phoenix-heex files.

ooo it’s true haha, i’m sorry.

Do you have Phoenix Framework - Visual Studio Marketplace ?


amazing :open_mouth: that works for me :slight_smile: thanks @APB9785

1 Like

Yes, I have. But still it is not working. :frowning: