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

Emmet doesn't work in eex files. #11

Closed
fahrradflucht opened this issue Jun 30, 2016 · 16 comments · Fixed by #36
Closed

Emmet doesn't work in eex files. #11

fahrradflucht opened this issue Jun 30, 2016 · 16 comments · Fixed by #36

Comments

@fahrradflucht
Copy link
Contributor

If you hit tab or fire the emmet expand abbr. command via the command it just makes a tab in eex files. I think it would be nice if it kept working like it does in HTML.

@timmhirsens
Copy link
Owner

Noticed this as well, will look into it once i find some time

@fahrradflucht
Copy link
Contributor Author

fahrradflucht commented Aug 4, 2016

Just to clarify whats going on (at least how I understand it):

The filetypes in which Emmet is enabled are hardcoded in the vscode source at the moment. That means the only way we could get emmet to work in .eex files is to associate the .eex extension with html but that would be bad because we would loose the elixir capabilities.

This means we are blocked on the issue above with this. Good news is that it's on the milestone for august.

Update: It's merged so if the next release goes out this is ready to work on.

Update 2: It's ready to work on.

@fahrradflucht
Copy link
Contributor Author

I looked into this and tried to implement it like it is done in vscode-vash and described here but I couldn't yet get it to work.

@fr1zle could you explain to me why there are two files for eex syntax (eex.json and html (eex).json)? I don't quite get the difference.

@MRMInc sorry for bothering you with this extension but you seem to have it working with vscode-vash. Can you tell at a glance why it isn't already working for html (exx)? I mean it already has text.html.elixir as a scope name...

@mrmlnc
Copy link

mrmlnc commented Sep 18, 2016

@fahrradflucht,

In your case you have incorrect format identifiers. See:

Now you can use the following format:

"emmet.syntaxProfiles": {
  "HTML (Eex)": "html"
}

Emmet does not work by default because we have a rule: If the language ID is not equal to last value in scopeName field, Emmet is not working.

@Pranz
Copy link

Pranz commented Oct 14, 2017

I have added

"emmet.syntaxProfiles": {
  "HTML (Eex)": "html"
}

to my config and reloaded, yet emmet still doesn't work on Eex files. My html.eex files have the language ID HTML (Eex) when opened.

@timmhirsens timmhirsens reopened this Oct 14, 2017
@timmhirsens
Copy link
Owner

Can reproduce.

Seems to be an issue with the new emmet (2.0): https://code.visualstudio.com/docs/editor/emmet
Will look into it.

@ashleyconnor
Copy link

@Pranz - try adding "emmet.includeLanguages": {"HTML (Eex)": "html"}

@timmhirsens
Copy link
Owner

@ashleyconnor : This seems to work when a added to a user settings. Somehow this does not work if I add a contribution to the extension providing the setting...

Any ideas?

@Pranz
Copy link

Pranz commented Oct 31, 2017

@ashleyconnor Thanks, works if I put it in my user config.

@smahi
Copy link

smahi commented Oct 28, 2018

@ashleyconnor thank you so much.

@koutselakismanos
Copy link

Now its "HTML (EEx)" not "HTML (Eex)"

@mplatts
Copy link

mplatts commented May 17, 2020

If you're using elixir-ls plugin - it's now:

"html-eex": "html"

@DarckBlezzer
Copy link

DarckBlezzer commented Aug 22, 2020

All before not working for me, and find that use "emmet.includeLanguages" with "html-eex": "html"

"emmet.includeLanguages": { "html-eex": "html" }

@lastobelus
Copy link

"emmet.includeLanguages": { "html-eex": "html" } is working for me for .eex & .leex files, but has anyone figured out how to get emmet expansion in sigils?

  def render(assigns) do
    ~L"""
      emmet here???
    """

@sbaildon
Copy link

sbaildon commented Jan 20, 2021

"emmet.includeLanguages": { "html-eex": "html" } is working for me for .eex & .leex files, but has anyone figured out how to get emmet expansion in sigils?

  def render(assigns) do
    ~L"""
      emmet here???
    """

Unfortunately this applies outside of sigils too, but yes, you can

"emmet.includeLanguages": {
    "elixir": "html",
},

The key is the language type, and the value is an "emmet supported language", although what those values are is a bit ambiguous (see microsoft/vscode-docs#3935)

@bottlenecked
Copy link

bottlenecked commented Sep 3, 2021

For anyone looking support for the new .heex the language you need to

    "emmet.includeLanguages": {
        ...
        "phoenix-heex": "html",
        ...
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.