mblode / vscode-twig-language

VS Code extension with snippets, syntax highlighting, hover, and formatting for Twig.
https://marketplace.visualstudio.com/items?itemName=mblode.twig-language
MIT License
42 stars 7 forks source link

Formatting wrap text will result in infinite indentation and auto-add double quotes for value #27

Closed 1aron closed 5 years ago

1aron commented 5 years ago

Before formatting

螢幕快照 2019-04-13 上午1 37 05

After formatting

螢幕快照 2019-04-13 上午1 37 21

Two problems:

  1. The wrap text would indent Infinitely.
  2. Shouldn't add double quotes for value automatically. class=p ( This should be a personal habit. )

The following code give you to test:

<div class="p">
    <h4>Market — your business
        {{ i + 1 }}</h4>
    <p class="mt-sm">
        Take the guesswork out of marketing with 
        built-in tools that help you create, execute,
        and analyze campaigns on Facebook and Google.
    </p>
</div>
mblode commented 5 years ago

You could set the wrap to 40 characters and have no issues. Otherwise, the formatter doesn't respond well to enter keys/line breaks in paragraphs of text