Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I combine Smarty tpl and HTML highlighting, hinting, snippets, autocomplete in VS Code

Using VS Code, I have "Smarty syntax highlighting" installed, works fine. I also set "emmet.includeLanguages": { "smarty": "html" }, so I can use emmet abbreviations, but I do not get the hinting/autocomplete for HTML.

I can add "files.associations": { "*.tpl":"html" } but then I loose the Smarty syntax highlighting.

Is there any way to treat the file as an HTML, and thus get the "stock" HTML emmet, autocomplete, hinting, and formatting but use the Smarty syntax highlighting offered by the extension? (or does anyone know of an extension that does this all-in-one?)

like image 217
Chad Avatar asked Sep 06 '25 03:09

Chad


2 Answers

I used it that way and it worked.

emmet.includeLanguages": {
   "smarty": "html"
}
like image 70
Luciano Baraúna Avatar answered Sep 10 '25 04:09

Luciano Baraúna


try ...

"emmet.syntaxProfiles": {
    "tpl": "html"
},
"emmet.includeLanguages": {
    "smarty": "html"
}
like image 32
red07 Avatar answered Sep 10 '25 05:09

red07