I have enable the "editor.formatOnSave" setting but in php files when the code is formate, all the open brackets are going to a new line. i just want them to stay in the same line ex
function test{ }
not
function test { }
I am looking for a solution all day but i cant find anything
Add the extension Format HTML in PHP to Visual Studio Code. Or search in extensions with "format HTML in PHP". After reload, use Shift + Alt + F .
If you want to have your php code formatted like this
function test { }
then use intelephense with the following settings.
"intelephense.format.braces": "k&r"
As @Pinonirvana said in his answer, you can now do this through the GUI.
You'll find this information under du user settings:
Short key -> Ctrl+,
or
File > Preferences > Settings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With