GrowyTobe
GrowyTobe

Reputation: 145

VS Code extension for autocompleting HTML tag in Twig files in Symfony 6 project

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') %}

Upvotes: 5

Views: 10192

Answers (2)

IOAyoub
IOAyoub

Reputation: 326

Go to your VSCode Settings, in the User tab, click Extensions, then Emmet.

Now, all you have to do is add an item in Include languages.

  • Item: twig
  • Value: html

Upvotes: 31

Franck Kengne
Franck Kengne

Reputation: 9

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,

Upvotes: 0

Related Questions