11
22import * as path from 'path' ;
3- import { spawn , execFile , ChildProcess } from 'mz/child_process' ;
3+ import { spawn , ChildProcess } from 'mz/child_process' ;
44import * as vscode from 'vscode' ;
55import { LanguageClient , LanguageClientOptions , StreamInfo } from 'vscode-languageclient' ;
66import * as semver from 'semver' ;
77import * as net from 'net' ;
88import * as url from 'url' ;
9+ import execa from 'execa' ;
910
1011export async function activate ( context : vscode . ExtensionContext ) : Promise < void > {
1112
1213 const conf = vscode . workspace . getConfiguration ( 'php' ) ;
13- const executablePath = conf . get < string > ( 'executablePath' ) || 'php' ;
14+ const executablePath = conf . get < string > ( 'executablePath' ) ||
15+ conf . get < string > ( 'validate.executablePath' ) ||
16+ ( process . platform === 'win32' ? 'php.exe' : 'php' ) ;
1417
1518 const memoryLimit = conf . get < string > ( 'memoryLimit' ) || '4095M' ;
1619
@@ -28,7 +31,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
2831 // Check path (if PHP is available and version is ^7.0.0)
2932 let stdout : string ;
3033 try {
31- [ stdout ] = await execFile ( executablePath , [ '--version' ] ) ;
34+ stdout = await execa . stdout ( executablePath , [ '--version' ] ) ;
3235 } catch ( err ) {
3336 if ( err . code === 'ENOENT' ) {
3437 const selected = await vscode . window . showErrorMessage (
0 commit comments