diff --git a/src/vs/base/browser/ui/messagelist/messageList.ts b/src/vs/base/browser/ui/messagelist/messageList.ts index 48e21c24b29d1acefb4db260232867d7e9bde920..28dc69c2eed16dedac3e84f525ab78dc94b13364 100644 --- a/src/vs/base/browser/ui/messagelist/messageList.ts +++ b/src/vs/base/browser/ui/messagelist/messageList.ts @@ -92,14 +92,14 @@ export class MessageList { public showMessage(severity: Severity, message: IMessageWithAction): () => void; public showMessage(severity: Severity, message: any): () => void { if (Array.isArray(message)) { - let closeFns: Function[] = []; + const closeFns: Function[] = []; message.forEach((msg: any) => closeFns.push(this.showMessage(severity, msg))); return () => closeFns.forEach((fn) => fn()); } // Return only if we are unable to extract a message text - let messageText = this.getMessageText(message); + const messageText = this.getMessageText(message); if (!messageText || typeof messageText !== 'string') { return () => {/* empty */ }; } @@ -162,7 +162,7 @@ export class MessageList { } private renderMessages(animate: boolean, delta: number): void { - let container = withElementById(this.containerElementId); + const container = withElementById(this.containerElementId); if (!container) { return; // Cannot build container for messages yet, return } @@ -182,7 +182,7 @@ export class MessageList { // Render Messages as List Items $(this.messageListContainer).ul({ 'class': 'message-list' }, (ul: Builder) => { - let messages = this.prepareMessages(); + const messages = this.prepareMessages(); if (messages.length > 0) { this._onMessagesShowing.fire(); } else { @@ -207,14 +207,14 @@ export class MessageList { container.li({ class: 'message-list-entry message-list-entry-with-action' }, (li) => { // Actions (if none provided, add one default action to hide message) - let messageActions = this.getMessageActions(message); + const messageActions = this.getMessageActions(message); li.div({ class: 'actions-container' }, (actionContainer) => { - for (let i = messageActions.length - 1; i >= 0; i--) { - let action = messageActions[i]; + for (let i = 0; i < messageActions.length; i++) { + const action = messageActions[i]; actionContainer.div({ class: 'message-action' }, (div) => { div.a({ class: 'action-button', tabindex: '0', role: 'button' }).text(action.label).on([DOM.EventType.CLICK, DOM.EventType.KEY_DOWN], (e) => { if (e instanceof KeyboardEvent) { - let event = new StandardKeyboardEvent(e); + const event = new StandardKeyboardEvent(e); if (!event.equals(CommonKeybindings.ENTER) && !event.equals(CommonKeybindings.SPACE)) { return; // Only handle Enter/Escape for keyboard access } @@ -241,17 +241,17 @@ export class MessageList { }); // Text - let text = message.text.substr(0, this.options.maxMessageLength); + const text = message.text.substr(0, this.options.maxMessageLength); li.div({ class: 'message-left-side' }, (div) => { div.addClass('message-overflow-ellipsis'); // Severity indicator - let sev = message.severity; - let label = (sev === Severity.Error) ? nls.localize('error', "Error") : (sev === Severity.Warning) ? nls.localize('warning', "Warn") : nls.localize('info', "Info"); + const sev = message.severity; + const label = (sev === Severity.Error) ? nls.localize('error', "Error") : (sev === Severity.Warning) ? nls.localize('warning', "Warn") : nls.localize('info', "Info"); $().span({ class: 'message-left-side severity ' + ((sev === Severity.Error) ? 'app-error' : (sev === Severity.Warning) ? 'app-warning' : 'app-info'), text: label }).appendTo(div); // Error message - let messageContentElement: HTMLElement = htmlRenderer.renderHtml({ + const messageContentElement: HTMLElement = htmlRenderer.renderHtml({ tagName: 'span', className: 'message-left-side', formattedText: text @@ -282,12 +282,12 @@ export class MessageList { private prepareMessages(): IMessageEntry[] { // Aggregate Messages by text to reduce their count - let messages: IMessageEntry[] = []; - let handledMessages: { [message: string]: number; } = {}; + const messages: IMessageEntry[] = []; + const handledMessages: { [message: string]: number; } = {}; let offset = 0; for (let i = 0; i < this.messages.length; i++) { - let message = this.messages[i]; + const message = this.messages[i]; if (types.isUndefinedOrNull(handledMessages[message.text])) { message.count = 1; messages.push(message); @@ -335,7 +335,7 @@ export class MessageList { let messageFound = false; for (let i = 0; i < this.messages.length; i++) { - let message = this.messages[i]; + const message = this.messages[i]; let hide = false; // Hide specific message @@ -373,7 +373,7 @@ export class MessageList { let counter = 0; for (let i = 0; i < this.messages.length; i++) { - let message = this.messages[i]; + const message = this.messages[i]; // Only purge infos and warnings and only if they are not providing actions if (message.severity !== Severity.Error && !message.actions) { diff --git a/src/vs/workbench/api/node/mainThreadMessageService.ts b/src/vs/workbench/api/node/mainThreadMessageService.ts index f00ee755f90cd62cac8adaa1f8640cb42672f69d..b3dcf3a23ae64e90d088984e73867b50cfd5ea42 100644 --- a/src/vs/workbench/api/node/mainThreadMessageService.ts +++ b/src/vs/workbench/api/node/mainThreadMessageService.ts @@ -49,7 +49,7 @@ export class MainThreadMessageService extends MainThreadMessageServiceShape { }); if (!hasCloseAffordance) { - actions.unshift(new MessageItemAction('__close', nls.localize('close', "Close"), undefined)); + actions.push(new MessageItemAction('__close', nls.localize('close', "Close"), undefined)); } messageHide = this._messageService.show(severity, { diff --git a/src/vs/workbench/browser/actions/openSettings.ts b/src/vs/workbench/browser/actions/openSettings.ts index 1a167a797823a531d0b21652f4dd4cbd892a3429..dd151ac74532e3f84d64f2b41a18fff736f5f338 100644 --- a/src/vs/workbench/browser/actions/openSettings.ts +++ b/src/vs/workbench/browser/actions/openSettings.ts @@ -148,19 +148,19 @@ export class OpenGlobalSettingsAction extends BaseOpenSettingsAction { this.messageService.show(Severity.Info, { message: nls.localize('workspaceHasSettings', "The currently opened folder contains workspace settings that may override user settings"), actions: [ - CloseAction, - new Action('neverShowAgain', nls.localize('neverShowAgain', "Don't show again"), null, true, () => { - this.storageService.store(OpenGlobalSettingsAction.SETTINGS_INFO_IGNORE_KEY, true, StorageScope.WORKSPACE); - - return TPromise.as(true); - }), new Action('open.workspaceSettings', nls.localize('openWorkspaceSettings', "Open Workspace Settings"), null, true, () => { let editorCount = this.editorService.getVisibleEditors().length; return this.editorService.createInput({ resource: this.contextService.toResource(WORKSPACE_CONFIG_DEFAULT_PATH) }).then((typedInput) => { return this.editorService.openEditor(typedInput, { pinned: true }, editorCount === 2 ? Position.RIGHT : editorCount === 1 ? Position.CENTER : void 0); }); - }) + }), + new Action('neverShowAgain', nls.localize('neverShowAgain', "Don't show again"), null, true, () => { + this.storageService.store(OpenGlobalSettingsAction.SETTINGS_INFO_IGNORE_KEY, true, StorageScope.WORKSPACE); + + return TPromise.as(true); + }), + CloseAction ] }); } diff --git a/src/vs/workbench/browser/parts/editor/editorCommands.ts b/src/vs/workbench/browser/parts/editor/editorCommands.ts index 5eee2ec04bfd8e306cbde83a59641834ba2d5694..b206187d7d05a65b3dea466b0f8a04a2ae3f1980 100644 --- a/src/vs/workbench/browser/parts/editor/editorCommands.ts +++ b/src/vs/workbench/browser/parts/editor/editorCommands.ts @@ -228,10 +228,10 @@ function handleCommandDeprecations(): void { messageService.show(Severity.Warning, { message: nls.localize('commandDeprecated', "Command **{0}** has been removed. You can use **{1}** instead", deprecatedCommandId, newCommandId), actions: [ - CloseAction, new Action('openKeybindings', nls.localize('openKeybindings', "Configure Keyboard Shortcuts"), null, true, () => { return commandService.executeCommand('workbench.action.openGlobalKeybindings'); - }) + }), + CloseAction ] }); }, diff --git a/src/vs/workbench/electron-browser/update.ts b/src/vs/workbench/electron-browser/update.ts index 037fe13bebc30b104a671f0f6f05ad61a49fdef0..1a55fda1e714de769b3476da9a4210452c6eade9 100644 --- a/src/vs/workbench/electron-browser/update.ts +++ b/src/vs/workbench/electron-browser/update.ts @@ -59,14 +59,14 @@ export class Update { ipc.on('vscode:update-downloaded', (event, update: IUpdate) => { this.messageService.show(severity.Info, { message: nls.localize('updateAvailable', "{0} will be updated after it restarts.", product.nameLong), - actions: [ShowReleaseNotesAction(product.releaseNotesUrl), NotNowAction, ApplyUpdateAction] + actions: [ApplyUpdateAction, NotNowAction, ShowReleaseNotesAction(product.releaseNotesUrl)] }); }); ipc.on('vscode:update-available', (event, url: string) => { this.messageService.show(severity.Info, { message: nls.localize('thereIsUpdateAvailable', "There is an available update."), - actions: [ShowReleaseNotesAction(product.releaseNotesUrl), NotNowAction, DownloadAction(url)] + actions: [DownloadAction(url), NotNowAction, ShowReleaseNotesAction(product.releaseNotesUrl)] }); }); diff --git a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts b/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts index 1711c4e21e06193453fe890f3c658b0f7bdbdd00..43cf9dcf42e8327f0a1ded1fc6521457b528ea05 100644 --- a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts +++ b/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts @@ -78,8 +78,8 @@ class InstallAction extends Action { return this.editorService.openEditor(input).then(() => { const message = nls.localize('again', "Please remove the '{0}' alias from '{1}' before continuing.", product.applicationName, file); const actions = [ - new Action('cancel', nls.localize('cancel', "Cancel")), - new Action('continue', nls.localize('continue', "Continue"), '', true, () => this.run()) + new Action('continue', nls.localize('continue', "Continue"), '', true, () => this.run()), + new Action('cancel', nls.localize('cancel', "Cancel")) ]; this.messageService.show(Severity.Info, { message, actions }); @@ -128,7 +128,6 @@ class InstallAction extends Action { return new TPromise((c, e) => { const message = nls.localize('warnEscalation', "Code will now prompt with 'osascript' for Administrator privileges to install the shell command."); const actions = [ - new Action('cancel2', nls.localize('cancel2', "Cancel"), '', true, () => { e(new Error(nls.localize('aborted', "Aborted"))); return null; }), new Action('ok', nls.localize('ok', "OK"), '', true, () => { const command = 'osascript -e "do shell script \\"mkdir -p /usr/local/bin && chown \\" & (do shell script (\\"whoami\\")) & \\" /usr/local/bin\\" with administrator privileges"'; @@ -137,7 +136,8 @@ class InstallAction extends Action { .done(c, e); return null; - }) + }), + new Action('cancel2', nls.localize('cancel2', "Cancel"), '', true, () => { e(new Error(nls.localize('aborted', "Aborted"))); return null; }) ]; this.messageService.show(Severity.Info, { message, actions }); @@ -211,7 +211,7 @@ class DarwinCLIHelper implements IWorkbenchContribution { messageService.show(Severity.Info, nls.localize('laterInfo', "Remember you can always run the '{0}' action from the Command Palette.", installAction.label)); return null; }); - const actions = [later, now]; + const actions = [now, later]; messageService.show(Severity.Info, { message, actions }); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index dd70b1c762e124b1429aab64531807eadee8dd18..2b4ffa6ac60415f6622367c329191e93d5a22198 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -553,7 +553,7 @@ export class DebugService implements debug.IDebugService { if (!this.configurationManager.adapter) { return configuration.type ? TPromise.wrapError(new Error(nls.localize('debugTypeNotSupported', "Configured debug type '{0}' is not supported.", configuration.type))) : TPromise.wrapError(errors.create(nls.localize('debugTypeMissing', "Missing property 'type' for the chosen launch configuration."), - { actions: [CloseAction, this.instantiationService.createInstance(debugactions.ConfigureAction, debugactions.ConfigureAction.ID, debugactions.ConfigureAction.LABEL)] })); + { actions: [this.instantiationService.createInstance(debugactions.ConfigureAction, debugactions.ConfigureAction.ID, debugactions.ConfigureAction.LABEL), CloseAction] })); } return this.runPreLaunchTask(configuration.preLaunchTask).then((taskSummary: ITaskSummary) => { @@ -568,10 +568,10 @@ export class DebugService implements debug.IDebugService { message: errorCount > 1 ? nls.localize('preLaunchTaskErrors', "Build errors have been detected during preLaunchTask '{0}'.", configuration.preLaunchTask) : errorCount === 1 ? nls.localize('preLaunchTaskError', "Build error has been detected during preLaunchTask '{0}'.", configuration.preLaunchTask) : nls.localize('preLaunchTaskExitCode', "The preLaunchTask '{0}' terminated with exit code {1}.", configuration.preLaunchTask, taskSummary.exitCode), - actions: [CloseAction, new Action('debug.continue', nls.localize('debugAnyway', "Debug Anyway"), null, true, () => { + actions: [new Action('debug.continue', nls.localize('debugAnyway', "Debug Anyway"), null, true, () => { this.messageService.hideAll(); return this.doCreateSession(configuration); - })] + }), CloseAction] }); }, (err: TaskError) => { if (err.code !== TaskErrors.NotConfigured) { @@ -580,7 +580,7 @@ export class DebugService implements debug.IDebugService { this.messageService.show(err.severity, { message: err.message, - actions: [CloseAction, this.taskService.configureAction()] + actions: [this.taskService.configureAction(), CloseAction] }); }); })))); @@ -704,9 +704,9 @@ export class DebugService implements debug.IDebugService { if (filteredTasks.length !== 1) { return TPromise.wrapError(errors.create(nls.localize('DebugTaskNotFound', "Could not find the preLaunchTask \'{0}\'.", taskName), { actions: [ - CloseAction, + this.instantiationService.createInstance(debugactions.ConfigureAction, debugactions.ConfigureAction.ID, debugactions.ConfigureAction.LABEL), this.taskService.configureAction(), - this.instantiationService.createInstance(debugactions.ConfigureAction, debugactions.ConfigureAction.ID, debugactions.ConfigureAction.LABEL) + CloseAction ] })); } diff --git a/src/vs/workbench/parts/emmet/node/actions/base64.ts b/src/vs/workbench/parts/emmet/node/actions/base64.ts index 2481a5a763bc0b6005a87d2752c096960ad60055..636ab0c1dc465d0e25a11f39438dc8ce91dbf10b 100644 --- a/src/vs/workbench/parts/emmet/node/actions/base64.ts +++ b/src/vs/workbench/parts/emmet/node/actions/base64.ts @@ -83,11 +83,11 @@ class EncodeDecodeDataUrlAction extends EmmetEditorAction { const message = nls.localize('warnEscalation', "File **{0}** already exists. Do you want to overwrite the existing file?", this.imageFilePath); const actions = [ - new Action('cancel', nls.localize('cancel', "Cancel"), '', true), new Action('ok', nls.localize('ok', "OK"), '', true, () => { this.encodeDecode(ctx, this.imageFilePath); return null; - }) + }), + new Action('cancel', nls.localize('cancel', "Cancel"), '', true) ]; messageService.show(Severity.Warning, { message, actions }); }); diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts index 4af77ab5c327b2dbb25b586828fadc9482ea724e..c349c71e48ea2c1422386c6ce5b7899debda4bda 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts @@ -125,7 +125,7 @@ export class ExtensionTipsService implements IExtensionTipsService { this.messageService.show(Severity.Info, { message, - actions: [CloseAction, neverAgainAction, recommendationsAction] + actions: [recommendationsAction, neverAgainAction, CloseAction] }); }); }); diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts index 661cee2d1cdbb6ebb7659ed8afbf25322658b7bd..1258c9ba3918791496ca81ccd0fedb3fb00ff541 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts @@ -97,7 +97,7 @@ export class UninstallAction extends Action { return this.extensionsWorkbenchService.uninstall(this.extension).then(() => { this.messageService.show(severity.Info, { message: localize('postUninstallMessage', "{0} was successfully uninstalled. Restart to deactivate it.", this.extension.displayName), - actions: [LaterAction, this.instantiationService.createInstance(ReloadWindowAction, ReloadWindowAction.ID, localize('restartNow', "Restart Now"))] + actions: [this.instantiationService.createInstance(ReloadWindowAction, ReloadWindowAction.ID, localize('restartNow', "Restart Now")), LaterAction] }); }); } diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts index 9afdb7509293a8c6a539df59ea919317d98e203e..84f2362f4dec1774b80d696ccb4c4533c07c12be 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts @@ -344,8 +344,8 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { if (!/ECONNREFUSED/.test(message)) { const error = createError(localize('suggestProxyError', "Marketplace returned 'ECONNREFUSED'. Please check the 'http.proxy' setting."), { actions: [ - CloseAction, - this.instantiationService.createInstance(OpenGlobalSettingsAction, OpenGlobalSettingsAction.ID, OpenGlobalSettingsAction.LABEL) + this.instantiationService.createInstance(OpenGlobalSettingsAction, OpenGlobalSettingsAction.ID, OpenGlobalSettingsAction.LABEL), + CloseAction ] }); diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts index 161b09e55e570d631aa4d42b1a3f93a9a1ed1f31..9ab53bfba9d0765d335082de7e31046073d61632 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts @@ -175,7 +175,6 @@ export class TextFileEditor extends BaseTextEditor { if ((error).fileOperationResult === FileOperationResult.FILE_NOT_FOUND && paths.isValidBasename(paths.basename((input).getResource().fsPath))) { return TPromise.wrapError(errors.create(errors.toErrorMessage(error), { actions: [ - CancelAction, new Action('workbench.files.action.createMissingFile', nls.localize('createFile', "Create File"), null, true, () => { return this.fileService.updateContent((input).getResource(), '').then(() => { @@ -188,7 +187,8 @@ export class TextFileEditor extends BaseTextEditor { } }); }); - }) + }), + CancelAction ] })); } diff --git a/src/vs/workbench/parts/files/browser/fileActions.ts b/src/vs/workbench/parts/files/browser/fileActions.ts index 64d059e2ed8699e9649ce13c9a87f5c22889f8c6..427b5e3a8a8ac6eeb666373cc694aaf2b06a1be9 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.ts @@ -129,16 +129,16 @@ export class BaseFileAction extends Action { protected onErrorWithRetry(error: any, retry: () => TPromise, extraAction?: Action): void { let actions = [ - CancelAction, - new Action(this.id, nls.localize('retry', "Retry"), null, true, () => retry()) + new Action(this.id, nls.localize('retry', "Retry"), null, true, () => retry()), + CancelAction ]; if (extraAction) { - actions.push(extraAction); + actions.unshift(extraAction); } let errorWithRetry: IMessageWithAction = { - actions: actions, + actions, message: errors.toErrorMessage(error, false) }; diff --git a/src/vs/workbench/parts/files/browser/saveErrorHandler.ts b/src/vs/workbench/parts/files/browser/saveErrorHandler.ts index d977ae010b58e2e12ec935d1fabf38a611085103..ad3577e68adf9492100b290f6c32e6fa3d15beb0 100644 --- a/src/vs/workbench/parts/files/browser/saveErrorHandler.ts +++ b/src/vs/workbench/parts/files/browser/saveErrorHandler.ts @@ -70,8 +70,21 @@ export class SaveErrorHandler implements ISaveErrorHandler { const isReadonly = (error).fileOperationResult === FileOperationResult.FILE_READ_ONLY; const actions: Action[] = []; - // Cancel - actions.push(CancelAction); + // Save As + actions.push(new Action('workbench.files.action.saveAs', SaveFileAsAction.LABEL, null, true, () => { + const saveAsAction = this.instantiationService.createInstance(SaveFileAsAction, SaveFileAsAction.ID, SaveFileAsAction.LABEL); + saveAsAction.setResource(resource); + + return saveAsAction.run().then(() => { saveAsAction.dispose(); return true; }); + })); + + // Discard + actions.push(new Action('workbench.files.action.discard', nls.localize('discard', "Discard"), null, true, () => { + const revertFileAction = this.instantiationService.createInstance(RevertFileAction, RevertFileAction.ID, RevertFileAction.LABEL); + revertFileAction.setResource(resource); + + return revertFileAction.run().then(() => { revertFileAction.dispose(); return true; }); + })); // Retry if (isReadonly) { @@ -91,21 +104,8 @@ export class SaveErrorHandler implements ISaveErrorHandler { })); } - // Discard - actions.push(new Action('workbench.files.action.discard', nls.localize('discard', "Discard"), null, true, () => { - const revertFileAction = this.instantiationService.createInstance(RevertFileAction, RevertFileAction.ID, RevertFileAction.LABEL); - revertFileAction.setResource(resource); - - return revertFileAction.run().then(() => { revertFileAction.dispose(); return true; }); - })); - - // Save As - actions.push(new Action('workbench.files.action.saveAs', SaveFileAsAction.LABEL, null, true, () => { - const saveAsAction = this.instantiationService.createInstance(SaveFileAsAction, SaveFileAsAction.ID, SaveFileAsAction.LABEL); - saveAsAction.setResource(resource); - - return saveAsAction.run().then(() => { saveAsAction.dispose(); return true; }); - })); + // Cancel + actions.push(CancelAction); let errorMessage: string; if (isReadonly) { @@ -116,7 +116,7 @@ export class SaveErrorHandler implements ISaveErrorHandler { message = { message: errorMessage, - actions: actions + actions }; } diff --git a/src/vs/workbench/parts/git/browser/gitServices.ts b/src/vs/workbench/parts/git/browser/gitServices.ts index 0dd68257327a6c71a3083fe1682d107b7824de70..3b8ab655e2e0a0d7d84105447173097bb62faf60 100644 --- a/src/vs/workbench/parts/git/browser/gitServices.ts +++ b/src/vs/workbench/parts/git/browser/gitServices.ts @@ -479,15 +479,15 @@ export class GitService extends EventEmitter messageService.show(severity.Warning, { message: localize('updateGit', "You seem to have git {0} installed. Code works best with git >=2.0.0.", version), actions: [ - CloseAction, + new Action('downloadLatest', localize('download', "Download"), '', true, () => { + shell.openExternal('https://git-scm.com/'); + return null; + }), new Action('neverShowAgain', localize('neverShowAgain', "Don't show again"), null, true, () => { storageService.store(IgnoreOldGitStorageKey, true, StorageScope.GLOBAL); return null; }), - new Action('downloadLatest', localize('download', "Download"), '', true, () => { - shell.openExternal('https://git-scm.com/'); - return null; - }) + CloseAction ] }); } @@ -792,7 +792,7 @@ export class GitService extends EventEmitter error = createError( localize('checkNativeConsole', "There was an issue running a git operation. Please review the output or use a console to check the state of your repository."), - { actions: [showOutputAction, cancelAction] } + { actions: [cancelAction, showOutputAction] } ); (error).gitErrorCode = gitErrorCode; diff --git a/src/vs/workbench/parts/nps/electron-browser/nps.contribution.ts b/src/vs/workbench/parts/nps/electron-browser/nps.contribution.ts index 60b54f1b647c79976ca3e93f642162fd7518f86f..0aee8541046bed4ca85807e9c0b46ed504f5f13e 100644 --- a/src/vs/workbench/parts/nps/electron-browser/nps.contribution.ts +++ b/src/vs/workbench/parts/nps/electron-browser/nps.contribution.ts @@ -85,7 +85,7 @@ class NPSContribution implements IWorkbenchContribution { return TPromise.as(null); }); - const actions = [takeSurveyAction, remindMeLaterAction, neverAgainAction]; + const actions = [neverAgainAction, remindMeLaterAction, takeSurveyAction ]; // TODO@Ben need this setTimeout due to #9769 setTimeout(() => messageService.show(Severity.Info, { message, actions })); diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 115571cc1092f50bb746cbb04ebbe7a0837b83d4..62d4e47de952fc051e8ff6538880316c6cbaf128 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -948,7 +948,7 @@ class TaskService extends EventEmitter implements ITaskService { ? this.getConfigureAction(buildError.code) : new TerminateAction(TerminateAction.ID, TerminateAction.TEXT, this, this.telemetryService, this.messageService, this.contextService); - closeAction.closeFunction = this.messageService.show(buildError.severity, { message: buildError.message, actions: [closeAction, action ] }); + closeAction.closeFunction = this.messageService.show(buildError.severity, { message: buildError.message, actions: [action, closeAction ] }); } else { this.messageService.show(buildError.severity, buildError.message); } diff --git a/src/vs/workbench/parts/update/electron-browser/update.contribution.ts b/src/vs/workbench/parts/update/electron-browser/update.contribution.ts index a8ef7ea585eda2c01f2887ae5a996d621d3f0559..e23f56134c6d949ac4edb6857bcf46a8f3c7e3b7 100644 --- a/src/vs/workbench/parts/update/electron-browser/update.contribution.ts +++ b/src/vs/workbench/parts/update/electron-browser/update.contribution.ts @@ -45,8 +45,8 @@ export class UpdateContribution implements IWorkbenchContribution { messageService.show(Severity.Info, { message: nls.localize('releaseNotes', "Welcome to {0} v{1}! Would you like to read the Release Notes?", product.nameLong, pkg.version), actions: [ - CloseAction, - ShowReleaseNotesAction(product.releaseNotesUrl, true) + ShowReleaseNotesAction(product.releaseNotesUrl, true), + CloseAction ] }); }, 0); @@ -58,8 +58,8 @@ export class UpdateContribution implements IWorkbenchContribution { messageService.show(Severity.Info, { message: nls.localize('licenseChanged', "Our license terms have changed, please go through them.", product.nameLong, pkg.version), actions: [ - CloseAction, - LinkAction('update.showLicense', nls.localize('license', "Read License"), product.licenseUrl) + LinkAction('update.showLicense', nls.localize('license', "Read License"), product.licenseUrl), + CloseAction ] }); }, 0); @@ -73,16 +73,16 @@ export class UpdateContribution implements IWorkbenchContribution { messageService.show(Severity.Info, { message: nls.localize('insiderBuilds', "Insider builds are becoming daily builds!", product.nameLong, pkg.version), actions: [ - CloseAction, - new Action('update.neverAgain', nls.localize('neverShowAgain', "Never Show Again"), '', true, () => { + new Action('update.insiderBuilds', nls.localize('readmore', "Read More"), '', true, () => { + shell.openExternal('http://go.microsoft.com/fwlink/?LinkID=798816'); storageService.store(UpdateContribution.INSIDER_KEY, false, StorageScope.GLOBAL); return TPromise.as(null); }), - new Action('update.insiderBuilds', nls.localize('readmore', "Read More"), '', true, () => { - shell.openExternal('http://go.microsoft.com/fwlink/?LinkID=798816'); + new Action('update.neverAgain', nls.localize('neverShowAgain', "Never Show Again"), '', true, () => { storageService.store(UpdateContribution.INSIDER_KEY, false, StorageScope.GLOBAL); return TPromise.as(null); - }) + }), + CloseAction, ] }); }, 0);