From 1d7d9046a21da9fde60ca7565e71548f27a5ed24 Mon Sep 17 00:00:00 2001 From: Ari Sanguinetti Date: Thu, 21 Mar 2019 23:15:48 -0300 Subject: [PATCH] Search for phpcs.xml file in workspace root folder This is my first time with vscode extensions, I think this change this might be useful. --- extension.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extension.js b/extension.js index e50ffbe..55bf1ec 100644 --- a/extension.js +++ b/extension.js @@ -47,8 +47,14 @@ class PHPCBF { ); } - this.standard = config.get("standard", null); + const pathToPhpcsConfig = workspace.rootPath + '/phpcs.xml'; + if(fs.existsSync(pathToPhpcsConfig)) { + this.standard = pathToPhpcsConfig; + } else { + this.standard = config.get("standard", null); + } + this.documentFormattingProvider = config.get( "documentFormattingProvider", true