open folder settings in right click menu of explorer does not work (fix #176060) (#211287)

This commit is contained in:
Benjamin Pasero 2024-04-24 20:51:24 +02:00 committed by GitHub
parent e934023cb5
commit a4ebfe7b37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View File

@ -145,7 +145,7 @@ async function deleteFiles(explorerService: IExplorerService, workingCopyFileSer
let confirmation: IConfirmationResult;
// We do not support undo of folders, so in that case the delete action is irreversible
const deleteDetail = distinctElements.some(e => e.isDirectory) ? nls.localize('irreversible', "This action is irreversible!") :
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");
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.");
// Check if we need to ask for confirmation at all
if (skipConfirm || (useTrash && configurationService.getValue<boolean>(CONFIRM_DELETE_SETTING_KEY) === false)) {

View File

@ -423,8 +423,17 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
}
});
}
run(accessor: ServicesAccessor, resource: URI) {
return accessor.get(IPreferencesService).openFolderSettings({ folderUri: resource });
async run(accessor: ServicesAccessor, resource?: URI) {
if (URI.isUri(resource)) {
await accessor.get(IPreferencesService).openFolderSettings({ folderUri: resource });
} else {
const commandService = accessor.get(ICommandService);
const preferencesService = accessor.get(IPreferencesService);
const workspaceFolder = await commandService.executeCommand<IWorkspaceFolder>(PICK_WORKSPACE_FOLDER_COMMAND_ID);
if (workspaceFolder) {
await preferencesService.openFolderSettings({ folderUri: workspaceFolder.uri });
}
}
}
}));
this._register(registerAction2(class extends Action2 {