vscode-phpsab icon indicating copy to clipboard operation
vscode-phpsab copied to clipboard

Weird change on "format" that causes syntax error in PHP

Open Spriz opened this issue 6 months ago • 4 comments

When formatting code with this extension it changes this line here: https://github.com/spawnia/sailor/blob/master/src/Codegen/ObjectLikeBuilder.php#L91

to:

        $this->converters->addBody                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       /** @lang PHP */ '];');

(it adds a bunch of whitespaces)

Running phpcbf from terminal doesn't do this

the phpcs error it's showing is from this rule

    <rule ref="Generic.WhiteSpace.ScopeIndent">
        <properties>
            <property name="indent" value="4" />
            <property name="exact" value="true" />
        </properties>
    </rule>

Spriz avatar Aug 30 '24 12:08 Spriz