question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

emmet.includeLanguages for one to many mapping

See original GitHub issue

How can I enable several languages for a given file extension please?

For example

"emmet.includeLanguages": {
        "tt": ["html", "css", "javascript"],
    }

Except this doesn’t work. I tried with multiple references to the key

"emmet.includeLanguages": {
        "tt": "html",
        "tt": "css",
        "tt": "javascript",
    }

and also with an embedded object

"emmet.includeLanguages": {
        "tt": {
        "html":"html",
        "css": "css",
        "javascript": "javascript",
    }

no joy 😦


"emmet.includeLanguages": {
        "erb": "html"
    }

_Originally posted by @abnersajr in https://github.com/Microsoft/vscode/issues/9500#issuecomment-339634819_

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:17
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

38reactions
ThibaultJanBeyercommented, Nov 20, 2018

+1 for this feature. Please add it 👍

Use case:

I’m using an HTML-templates to create my HTML elements inside javascript. I use an extension for syntax highlighting which works perfectly. However, Emmet does not work in that file. Only if I add emmet.includeLanguages it will work. But as the limit of language mappings is 1. I can only map HTML or CSS to that JS file. However, I write both, HTML and CSS in that single file.

I’m sure we are not the only 2.

Thank you!

17reactions
fortinmikecommented, Dec 16, 2018

We’d also like this to be possible.

A concrete use case for this feature:

  • React in .js files (which is suggested in the React documentation and plays nicer with the Chromium Dev Tools in Electron)
  • A CSS in JS framework like styled-components, also in .js files

With this setup, we must either choose between Emmet in JSX (in our components’ render functions) or Emmet in CSS (in our styled-components’ template strings).

As a side-note it would be nice if Emmet could be configured not just per file type but also separately for template strings as those often embed other languages in JS. Specifying that Emmet’s CSS (or whatever syntax) support should be enabled in template strings only would be more granular than “everywhere in JS” and cover most use cases, I think.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Emmet in Visual Studio Code
Show Emmet suggestions in all Emmet supported modes as well as the languages that have a mapping in the emmet.includeLanguages setting. Note: In...
Read more >
Using Emmet feature for html, css within php file in Visual ...
The only thing is that emmet.includeLanguages doesn't support one to many mapping yet, so you can map to only one entity, either html...
Read more >
VS Code tips — Enable emmet abbreviations in any language ...
Like using Emmet abbreviations in VS Code for html or css? You can enable them in other languages with " emmet. includeLanguages "...
Read more >
Can VS Code Do Emmet? - CSS-Tricks
Map a keyboard shortcut to the “Wrap With Abbreviation” command. This makes it super quick to create things like anchors. Emmet In Other...
Read more >
Auto-Format HTML Templates in Django with VSCode
Using the Open Weather Map API with Python ... We will start with a basic pipeline template as provided by gitlab.com:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found