skip to Main Content

I’m looking for a VS Code extension which help me autocomplete my HTML tag in twig files.

I would like to write "h1", then press enter and get:

<h1></h1>

For now I installed thoses extensions: "Symfony code snippets And Twig Support & Yaml", "Twig", "Twig Language 2", "Twig Language", but it didn’t work. Can someone recommend me one?

I also don’t have autocompletion if I’m trying to write for example:

{% for message in app.session.flashBag.get('info') %}

2

Answers


  1. Just go to your VSCode Settings > in User tab > Extensions > Emmet. All you have to do is adding an item in "Include languages".

    • Item : twig
    • Value : html
    Login or Signup to reply.
  2. Just go to your VSCode Settings > in User tab > Extensions > Emmet. All you have to do is adding an item in "Include languages.then in the preferences file and click on "edit in settings.json.write "twig" :"html". Then returns to the file and clicks on the extension at the bottom right of the editor.a window appears at the top of the editor,click on Configuer twig.then you select "html" so that the twig file is considered as the html file.then download the extension "twig pack" and voila,

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search