From 2bbf94137071e5c92e5be1d54cd3f69f1b0a0199 Mon Sep 17 00:00:00 2001 From: tsuyoshi shirahama Date: Fri, 6 Sep 2024 10:49:09 +0900 Subject: [PATCH] Add support for using VSCode's php.validate.executablePath setting --- src/PhpCommand.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PhpCommand.ts b/src/PhpCommand.ts index 05ca0a6..e2ff314 100644 --- a/src/PhpCommand.ts +++ b/src/PhpCommand.ts @@ -1,5 +1,6 @@ import { spawn } from "node:child_process"; import { platform } from "node:os"; +import { workspace } from "vscode"; export default class PhpCommand { constructor(private cmd: string, private args: Array, private cwd?: string) { } @@ -9,7 +10,7 @@ export default class PhpCommand { this.args = [this.cmd].concat(this.args); // TODO: Fail when no PHP command, check with command-exists package - this.cmd = 'php'; + this.cmd = workspace.getConfiguration('php.validate').get('executablePath', 'php'); } const exec = spawn(this.cmd, this.args, {