mirror of
https://github.com/Microsoft/vscode
synced 2024-07-07 19:50:26 +00:00
This commit is contained in:
parent
e934023cb5
commit
a4ebfe7b37
|
@ -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)) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user