VS Code, HTML code format with Twig or Swig tags

Is there a way to format the HTML in VSCode when we use Twig or Swig tags, for example

{% if ... %} {%else%} {%endif%} {% for %} {%endfor%} {% include %}, etc...

Code formatting now removes all line breaks before and after these tags.

Could not find a suitable extension for this. There is no way to configure internal code formatting.

+4
source share
1 answer

I had the same problem and decided to install this extension:

Twig language

Install it, restart the editor, and if you are in windows, you can format them with the standard one ALT + SHIFT + F.

Hope this helps.

+1

Source: https://habr.com/ru/post/1662276/


All Articles