There's some demand for configuring the formatting of braces. I'd rather keep this simple and not offer configuration for every possible context. I'm proposing the following config that would cover all usage of braces, eg in control statements, functions, classes etc.
"intelephense.format.braces": {
"type": "string",
"default": "psr12",
"enum": [
"psr12",
"allman",
"k&r"
],
"enumDescriptions": [
"PHP-FIG PSR-2 and PSR-12 style. A mix of Allman and K&R",
"Allman. Opening brace on the next line.",
"K&R (1TBS). Opening brace on the same line."
],
"description": "Controls formatting style of braces",
"scope": "window"
}
Great idea. Can we test it?
This will be a life saver, meanwhile php-cs-fixer still doesn't have PSR-12 support
Good job!
Would love to see this
+1
Is there a workaround in the meantime? The k&r braces are driving me nuts! 馃槃
Please provide for this
Can't wait till this is implemented 馃憤
I'd also love to see this option as I have to switch between the two curly brace options for different projects.
Most helpful comment
+1
Is there a workaround in the meantime? The k&r braces are driving me nuts! 馃槃