Skip to content

Commit a4ebfe7

Browse files
authored
open folder settings in right click menu of explorer does not work (fix microsoft#176060) (microsoft#211287)
1 parent e934023 commit a4ebfe7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/vs/workbench/contrib/files/browser/fileActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async function deleteFiles(explorerService: IExplorerService, workingCopyFileSer
145145
let confirmation: IConfirmationResult;
146146
// We do not support undo of folders, so in that case the delete action is irreversible
147147
const deleteDetail = distinctElements.some(e => e.isDirectory) ? nls.localize('irreversible', "This action is irreversible!") :
148-
distinctElements.length > 1 ? nls.localize('restorePlural', "You can restore these files using the Undo command") : nls.localize('restore', "You can restore this file using the Undo command");
148+
distinctElements.length > 1 ? nls.localize('restorePlural', "You can restore these files using the Undo command.") : nls.localize('restore', "You can restore this file using the Undo command.");
149149

150150
// Check if we need to ask for confirmation at all
151151
if (skipConfirm || (useTrash && configurationService.getValue<boolean>(CONFIRM_DELETE_SETTING_KEY) === false)) {

src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,17 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
423423
}
424424
});
425425
}
426-
run(accessor: ServicesAccessor, resource: URI) {
427-
return accessor.get(IPreferencesService).openFolderSettings({ folderUri: resource });
426+
async run(accessor: ServicesAccessor, resource?: URI) {
427+
if (URI.isUri(resource)) {
428+
await accessor.get(IPreferencesService).openFolderSettings({ folderUri: resource });
429+
} else {
430+
const commandService = accessor.get(ICommandService);
431+
const preferencesService = accessor.get(IPreferencesService);
432+
const workspaceFolder = await commandService.executeCommand<IWorkspaceFolder>(PICK_WORKSPACE_FOLDER_COMMAND_ID);
433+
if (workspaceFolder) {
434+
await preferencesService.openFolderSettings({ folderUri: workspaceFolder.uri });
435+
}
436+
}
428437
}
429438
}));
430439
this._register(registerAction2(class extends Action2 {

0 commit comments

Comments
 (0)