Open kanlukasz opened 4 years ago
Hi! Can you please share your "Format html in php" settings? I have completely other results after formatting.
I don't have any settings - I mean everything is default. After formatting, I have:
<?php if ($count_rest == 1) : ?>
<div class="row row-cols-1 row-cols-md-2 text-center">
<?php endif; ?>
<?php the_excerpt(); ?>
<?php if ($query_blog->current_post + 1 == $query_blog->post_count) : ?>
</div>
<?php endif; ?>
As you can see, the indentation is wrong
Tested on clean VSCode portable version without any additional settings
The sad truth is that there is no perfect formatter for mixed code. PHPStorm can't do that either. Wordpress Coding Standard for PHP Code Sniffer also can't do it
Mixing HTML with PHP is a story that should never have happened anywhere, but as we know Wordpress lives its own life 🤷♂️
I feel your pain. I am slowly giving up about to find a formatter for mixed code. Are you using in parallel a php formatter in vscode?
I'm not sure what you mean by "parallel", anyway I can say that I'm using PHP Intelephense, which has formatter and many other cool features.
Describe the bug Wrong formatting
To Reproduce
Expected behavior
Platform and version