phpvisual-studio-code

Visual Studio Code PHP Inteliphense Formatting Brace On The Same Line With Statement


I just hate formatting like this:

public function foo()
{
    // do the magic
}

I recently installed the PHP Inteliphense extension in VSCode especially for formatting. Exploring the extension settings I couldn't find any option related to formatiing except Format enable/disable.

Is there any possibility to fix this and to get the brace on the first line?


Solution

  • I agree: K&R braces are the norm, and they're a LIFESAVER when it comes to long text extending over many lines. The PSR 12 "coding standards" are just stupid :(

    ANYWAY: check out Intellphense issue#509 and issue #730.

    Once possible workaround (suggested in issue #509) might be .jsbeautifyrc.

    FYI, I use phpfmt for Visual Studio Code. It works great - including brace formatting :)