soderlind / vscode-phpcbf

PHP Code Beautifier and Fixer for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=persoderlind.vscode-phpcbf
GNU General Public License v3.0
28 stars 10 forks source link

Allow configuration from `.vscode/settings.json` when in a Multi-root project. #6

Closed WraithKenny closed 6 years ago

WraithKenny commented 6 years ago

The conflict is only the version number

WraithKenny commented 6 years ago

Sorry for the white space in the diff, my code editor automatically does that.

soderlind commented 6 years ago

Thank you :)

soderlind commented 6 years ago

Found one error, if ${workspaceRoot} is used, this will fail:

        if (this.executablePath.startsWith("${workspaceRoot}") || this.executablePath.startsWith("${workspaceFolder}")) {
            this.addRootPath("${workspaceFolder}");
        }

.. I've fixed it

WraithKenny commented 6 years ago

I don't think the code would've failed. workspaceRoot is deprecated (but still functional) and should generally be replaced with workspaceFolder.

I see how it might be desirable to support it as it was previously, as workspaceRoot will resolve to the first folder (workspaceFolders[0]) instead of the current folder, if anyone wants to rely on that (its a bit hacky behavior). Maybe leave it as an undocumented feature :-)