Skip to content

Commit

Permalink
Add support for using VSCode's php.validate.executablePath setting
Browse files Browse the repository at this point in the history
  • Loading branch information
msx2mac authored and d8vjork committed Sep 6, 2024
1 parent 8558bbb commit 2bbf941
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PhpCommand.ts
Original file line number Diff line number Diff line change
@@ -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<string>, private cwd?: string) { }
Expand All @@ -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, {
Expand Down

0 comments on commit 2bbf941

Please sign in to comment.