Stillat / vscode-antlers-language-server

Provides rich language features for Statamic's Antlers templating language, including code completions, syntax highlighting, and more.
https://antlers.dev
MIT License
36 stars 3 forks source link

FR: Disabling format in file #64

Closed johncarter- closed 1 year ago

johncarter- commented 1 year ago

Which Antlers Toolbox products are you requesting a feature for?

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like I'd like to be able to turn off formatting for a specific section of code

{{# @format false #}}
<div class="dont format me">
Hahaha
</div>
{{# @format true #}}

Describe alternatives you've considered None

Additional context Same feature as this in Blade https://marketplace.visualstudio.com/items?itemName=shufo.vscode-blade-formatter#disabling-format-in-file

JohnathonKoster commented 1 year ago

This is now available in the following versions:

To disable formatting, we can use the special {{# format-ignore-start #}} and {{# format-ignore-end #}} Antlers comments:

<div>
<div>
{{# format-ignore-start #}}
<div class="class1 class2">
            This section
                will not be formatted.
        </div>
{{# format-ignore-end #}}
</div>
</div>

The special formatting comments must appear on separate lines by themselves.