@@ -86,7 +86,7 @@ export function activate(context: vscode.ExtensionContext): any {
8686}
8787
8888function updateStatusBarItem ( context : vscode . ExtensionContext , editor : vscode . TextEditor = vscode . window . activeTextEditor ) : void {
89- statusBarItem . tooltip = context . workspaceState . get < string > ( PathKey , undefined ) || vscode . workspace . getConfiguration ( 'php.validate' ) . get ( 'executablePath' , undefined ) ;
89+ statusBarItem . tooltip = getExecutablePath ( context ) ;
9090 if ( editor && editor . document && editor . document . languageId === 'php' ) {
9191 statusBarItem . show ( ) ;
9292 } else {
@@ -95,7 +95,7 @@ function updateStatusBarItem(context: vscode.ExtensionContext, editor: vscode.Te
9595}
9696
9797function onPathClicked ( context : vscode . ExtensionContext , validator : PHPValidationProvider ) {
98- let value = context . workspaceState . get < string > ( PathKey ) ;
98+ let value = getExecutablePath ( context ) ;
9999 vscode . window . showInputBox ( { prompt : localize ( 'php.enterPath' , 'The path to the PHP executable' ) , value : value || '' } ) . then ( value => {
100100 if ( ! value ) {
101101 // User pressed Escape
@@ -108,6 +108,18 @@ function onPathClicked(context: vscode.ExtensionContext, validator: PHPValidatio
108108 } ) ;
109109}
110110
111+ function getExecutablePath ( context : vscode . ExtensionContext ) : string {
112+ let result = context . workspaceState . get < string > ( PathKey , undefined ) ;
113+ if ( result ) {
114+ return result ;
115+ }
116+ let section = vscode . workspace . getConfiguration ( 'php.validate' ) ;
117+ if ( section ) {
118+ return section . get ( 'executablePath' , undefined ) ;
119+ }
120+ return undefined ;
121+ }
122+
111123function migrateExecutablePath ( settingsExecutablePath : string ) : Thenable < string > {
112124 return vscode . window . showInputBox (
113125 {
0 commit comments