Vscode-intelephense: Add formatter config for braces

Created on 20 Oct 2019  路  7Comments  路  Source: bmewburn/vscode-intelephense

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"
                }
enhancement

Most helpful comment

+1

Is there a workaround in the meantime? The k&r braces are driving me nuts! 馃槃

All 7 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pseudoanime picture pseudoanime  路  3Comments

vanasis picture vanasis  路  4Comments

aleksandervines picture aleksandervines  路  3Comments

zlianon picture zlianon  路  3Comments

ghnp5 picture ghnp5  路  3Comments