Reputation: 29178
I have read many similar questions on SO, but none answer my problem.
I have a .php
file with this content:
<?php something(); ?>
<div class="container">
<div class="row">
<div class="col">
Hello World!
</div>
</div>
</div>
And I would like to reformat either the php or the html code, either globally or the selection.
I have tried all the Format document
option, but it does not work.
Ctrl+Shift+p, Format document
If I change the extension for .html
, then it works.
Upvotes: 2
Views: 9512
Reputation: 560
There are many extensions in the marketplace of VSCODE for formatting the code. Try one of them. I might even recommend Prettier ext. Try others as well you might one usefull
Upvotes: 3