microsoft / typescript-lit-html-plugin

TypeScript server plugin that adds intellisense for lit-html template strings
MIT License
253 stars 20 forks source link

Emmet support #2

Open mjbvz opened 6 years ago

mjbvz commented 6 years ago

Add support for using emmet abbreviations inside lit-html templates

Should probably use https://www.npmjs.com/package/vscode-emmet-helper

mjbvz commented 6 years ago

This already works in VS Code if you change the document language to jsx/tsx, or if you set:

"emmet.includeLanguages": {
        "typescript": "html",
      "javascript": "html"
}
Pliavi commented 5 years ago

I use both react and lit-html in VSCode, there is a way to make "html" surpass "javascripreact" inside the tagged string? As i type .my-class it turns into <div className="my-class">, there is any "language id" to the tagged string? Or the only way is defining a config for each workspace?

ccsCoder commented 3 years ago

verified @mjbvz's solution. It works out of the box once your have those settings. Thanks !

bk-m commented 1 year ago

Setting

"emmet.includeLanguages":
    "typescript": "html"
}

does make emmet work in HTML templates in Typescript files. However my user-defined snippets for Typescript will no longer work (i.e. snippets defined in "Configure user snippets" => "typescript.json" will simply not show up in code completion).

Does anyone know how to make emmet work and still have access to your snippets?