Skip to content

Commit 9dc95af

Browse files
committed
Fixes microsoft#19436: Add support to edit the php executable path as a non sharable workspace setting
1 parent 6a4016f commit 9dc95af

1 file changed

Lines changed: 31 additions & 5 deletions

File tree

extensions/php/src/phpMain.ts

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ export function activate(context: vscode.ExtensionContext): any {
5353
let settingsExecutablePath = readLocalExecutableSetting();
5454
if (settingsExecutablePath) {
5555
migrateExecutablePath(settingsExecutablePath).then((value) => {
56+
context.workspaceState.update(MigratedKey, true);
5657
// User has pressed escape;
5758
if (!value) {
5859
// activate the validator with the current settings.
5960
validator.activate(context.subscriptions);
6061
return;
6162
}
62-
context.workspaceState.update(MigratedKey, true);
6363
context.workspaceState.update(PathKey, value);
6464
validator.updateWorkspaceExecutablePath(value, false);
6565
validator.activate(context.subscriptions);
@@ -121,12 +121,38 @@ function getExecutablePath(context: vscode.ExtensionContext): string {
121121
}
122122

123123
function migrateExecutablePath(settingsExecutablePath: string): Thenable<string> {
124-
return vscode.window.showInputBox(
124+
return vscode.window.showInformationMessage(
125+
localize('php.migrateWorkspaceSetting', 'Do you want to use {0} as your future PHP executable path?', settingsExecutablePath),
126+
{
127+
title: localize('php.yes', 'Yes'),
128+
id: 'yes'
129+
},
125130
{
126-
prompt: localize('php.migrateExecutablePath', 'Use the above path as the PHP executable path?'),
127-
value: settingsExecutablePath
131+
title: localize('php.edit', 'Edit'),
132+
id: 'edit'
133+
},
134+
{
135+
title: localize('php.more', 'Learn More'),
136+
id: 'more'
137+
}
138+
).then((selected) => {
139+
if (!selected) {
140+
return undefined;
128141
}
129-
);
142+
if (selected.id === 'yes') {
143+
return settingsExecutablePath;
144+
} else if (selected.id === 'edit') {
145+
return vscode.window.showInputBox(
146+
{
147+
prompt: localize('php.migrateExecutablePath', 'Use the above path as the PHP executable path?'),
148+
value: settingsExecutablePath
149+
}
150+
);
151+
} else if (selected.id === 'more') {
152+
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse('https://go.microsoft.com/fwlink/?linkid=839919'));
153+
return undefined;
154+
}
155+
});
130156
}
131157

132158
function readLocalExecutableSetting(): string {

0 commit comments

Comments
 (0)