Prettier for HTML, CSS, and JavaScript files "faultFormatter": "junstyle.php-cs-fixer", ![]() If you're on Mac, give ⌥⇧F a try.įor the best format setting for mixed PHP, HTML, and JavaScript code, just use 'PHP CS FIXER'.Īnd then use this simple configuration on your setting.json file: "php-cs-fixer.executablePath": "$\\php-cs-fixer.phar", They mostly seem to use the standard shortcut of Alt Shift F on Windows/Linux, with varying shortcuts on Mac. A quick search reveals at least three (1, 2, and Visual Studio Code has pretty awesome PHP support. PHP code formatting and will direct you to the extension marketplace if you attempt to format PHP without an appropriate extension installed. Visual Studio Code continues to lack built-in support for The free version of Intelephense supports code formatting with the usual shortcuts (Alt Shift F on Windows and Linux, ⌥⇧F on macOS). The only decent extension still standing of which I'm aware is PHP Intelephense, which uses a freemium model: basic features are free, and a lifetime license is $12 USD as of writing. The extensions to which I originally linked are abandoned, and Visual Studio Code's intrinsic PHP support hasn't improved, which is disappointing. ![]() It's been more than half a decade since I first wrote this answer. 1,106 2 gold badges 13 silver badges 24 bronze badges
0 Comments
Leave a Reply. |