vscode-twig-language-2 icon indicating copy to clipboard operation
vscode-twig-language-2 copied to clipboard

Can you please remove the complete formatting functionality

Open kevinmu17 opened this issue 4 years ago • 7 comments

It is so broken, i know, you are using prettyDiff... They where the reason i switched from atom to vscode, bad maintained!

Your extension does a great job with highlighting and snippets which I want to keep. But the formatting I want to ommit. It seems that the config "Twig-language-2: Formatting" doesn't do it's job when turned off, it gives me a message when trying to prettify my code "Extension Twig-language-2 cannot format template" so it's still blocking in a way.

Hope you can help!

kevinmu17 avatar Dec 16 '20 20:12 kevinmu17

I'll dove into the problem, somehow it didn't removed the line "editor.defaultFormatter": "mblode.twig-language-2" from the settings.json. So it still called the formatter to do it's job.

I found out that the problem lies within COMMENTS. if you place comments inside a div with attributes it messed up everything. if you make a comment on only 1 line, not nested in any element, it will be fine (this should need a fix though)

kevinmu17 avatar Dec 17 '20 10:12 kevinmu17

Same problem for me with comments between blocks :

{% block body %}
   {#
      My comment between block
    #}
{% endblock body %}
{#
   My comment outside block
#}

After some "auto formatting"

{% block body %}
   {#
                                                   My comment between block
                                                 #}
{% endblock body %}
{#
   My comment outside block
#}

samche2000 avatar Jan 05 '21 13:01 samche2000

Same problem here, with the Comments, my editor.defaultFormatter is set to None

estebancastro avatar Jun 12 '21 06:06 estebancastro

Was about to post the same issue. This needs to be fixed as comments are impossible to format.

the-sides avatar Jul 10 '21 23:07 the-sides

Same with {% set %} tags. Everything indents after them

mattbloomfield avatar Nov 10 '21 15:11 mattbloomfield

This formatter also ignores indentation type setting and forces you to use tabs like a caveman.

ErnstStavroBlofeld avatar Jan 07 '22 00:01 ErnstStavroBlofeld

+1

chrisvidal avatar Apr 05 '22 09:04 chrisvidal