Closed bgarrant closed 6 years ago
All HTML functions including Autocomplete/Intellesense should work within Twig as well. That is how PHPStorm and Atom works.
Somehow this old extension kind of had it working https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-twig-pack
I will release a working version later tonight! Get excited!!
Just to clarify, do you also want formatting of twig to work in .html files?
We need the HTML Autocomplete to work along with Twig. I think the way that older extension did it is made use of the .html extension so that Twig and HTML Autocomplete would both work.
So if you type <div
you should see the Autocomplete/Intellesense wrench icon in the suggestions. All I get is the word based ABC one
Great work on all this by the way Matt
I think VSC has to believe that .html and .twig both are HTML syntax. Then it can be tricked so Autocomplete works. Somehow they did it with https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-twig-pack. If you open a .html or .twig file it says syntax HTML in corner
Maybe that is how they had it working
The formatting, coloring, everything should work same in .html and .twig ideally. Hopefully that helps.
It's 2021 and I have the same issue, even after adding every twig extensions I found
@Arnauw I'm also still looking forward for a fix...
Me too...
Had the same issue and found this on details for Twig Language 2 extension. Make sure you install Twig language too and follow the below
This extension does not have HTML Intellisense. If you need HTML Intellisense (which can be quite useful), please download my other Twig Language extension: https://github.com/mblode/vscode-twig-language.
Add the below into your settings and it works a treat
"files.associations": {
"*.html": "twig"
},
"emmet.includeLanguages": {
"twig": "html"
},
It's work for me. Great!! Thanks @nhurst-knight
Works for me too.
Thanks, it works.
I have been looking for this solution for too long , Thanks A Lot !
Thank you !!!
Still experiencing this to be not working with the latest version in March 2023. Set interpreter to "HTML (Twig" -> All autocompleting for HTML tags gone
Can you add the setting so the HTML Autocomplete/Intellesense works when using .twig or .html? I thought there was a user setting for it, but it appears it is in the extension. Just start typing
<div
and you should get the Intellesense pop up. It is not working when twig syntax is used. If you look at the Twig Pack extension it does work in that one somehow. Not sure that is best example but you get that idea.