How to enable auto-suggest of HTML in Twig templates?

I’m working in Symfony (PHP) project having Twig as a template engine and templates are having file extension as *.html.twig e.g. welcome.html.twig. It seems that when I try to write HTML tags, it doesn’t seem to be showing auto-suggestions. Can you please guide why and how to solve the same. Thanks.

[original thread by Hiren Chhatbar]

@hirenchhatbar can you please provide additional information if possible, which extensions have you include to provide twig support? Quickly testing in vscode the use-case is not handled as well (when including the twig extension).

You can do the following (add the preference) but then you will lose twig syntax-highlighting and support:

"files.associations": {
   "*.twig": "html"

This looks like a limitation of the extension itself.
Perhaps the following extension might be better as it highlights having html intellisense present:

[Hiren Chhatbar]

@vince-fugnitto - Thanks for looking into. With above settings, it works great and loads HTML tags as suggestion. But you are right that twig syntax-highlighting and support is lost.

Regarding, initially, my idea was to use that VS extension but I wasn’t able to find any good article about how to install VS extension with theia. What articles I read were asking VSIX file which I couldn’t find anywhere. So, I was wondering how to make such extension available with theia. Can you please throw some good articles or instruction which I can follow and try to install that extension.

Personally, I had a talk with my frontend developer and he had great DEV experience working with theia as remote editor. It solves many problems being remote as well.

@hirenchhatbar I’m happy to hear you’re using Theia :slight_smile: For the .vsix of twig-language, I’d suggest simply trying the extension for now (by using the download link from the marketplace and adding it to your plugins folder), and if the extension suits your needs then you could either think of forking the repo and creating .vsix releases or propose to add it to the open-source marketplace known as open-vsx.

The actual release of extensions is quite easy, it requires you to build the extension and use the tool vsce to package it into a .vsix. The vscode documentation which I’ve linked would be the easiest guide to follow.

[Hiren Chhatbar]

@vince-fugnitto OK, that’s great. I’ll surely give it a try and let you know the outcome. I’m grateful to you and thanking you for all your support, time and effort. Really appreciated. :slight_smile: