diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts index 790a54f05d9ff6bda4c290caed8688ec88543061..3feb60de1c3e8f14085cd7ee7420c386d571d057 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -39,7 +39,7 @@ import { OS } from 'vs/base/common/platform'; import { IRange } from 'vs/editor/common/core/range'; import { ITextModel } from 'vs/editor/common/model'; import { INotificationService, INotification, INotificationHandle, NoOpNotification } from 'vs/platform/notification/common/notification'; -import { IConfirmation, IConfirmationResult, IConfirmationService } from 'vs/platform/dialogs/common/dialogs'; +import { IConfirmation, IConfirmationResult, IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IPosition, Position as Pos } from 'vs/editor/common/core/position'; export class SimpleEditor implements IEditor { @@ -236,7 +236,7 @@ export class SimpleProgressService implements IProgressService { } } -export class SimpleConfirmationService implements IConfirmationService { +export class SimpleDialogService implements IDialogService { public _serviceBrand: any; diff --git a/src/vs/editor/standalone/browser/standaloneServices.ts b/src/vs/editor/standalone/browser/standaloneServices.ts index 3e056e7870364f4194913465d195a7524979c15e..c84ca2cf87dfb199802a59e6db81046124666f3b 100644 --- a/src/vs/editor/standalone/browser/standaloneServices.ts +++ b/src/vs/editor/standalone/browser/standaloneServices.ts @@ -33,7 +33,7 @@ import { CodeEditorServiceImpl } from 'vs/editor/browser/services/codeEditorServ import { SimpleConfigurationService, SimpleResourceConfigurationService, SimpleMenuService, SimpleProgressService, StandaloneCommandService, StandaloneKeybindingService, SimpleNotificationService, - StandaloneTelemetryService, SimpleWorkspaceContextService, SimpleConfirmationService + StandaloneTelemetryService, SimpleWorkspaceContextService, SimpleDialogService } from 'vs/editor/standalone/browser/simpleServices'; import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService'; import { IMenuService } from 'vs/platform/actions/common/actions'; @@ -41,7 +41,7 @@ import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneT import { StandaloneThemeServiceImpl } from 'vs/editor/standalone/browser/standaloneThemeServiceImpl'; import { ILogService, NullLogService } from 'vs/platform/log/common/log'; import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IConfirmationService } from 'vs/platform/dialogs/common/dialogs'; +import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; export interface IEditorContextViewService extends IContextViewService { dispose(): void; @@ -126,7 +126,7 @@ export module StaticServices { export const telemetryService = define(ITelemetryService, () => new StandaloneTelemetryService()); - export const confirmationService = define(IConfirmationService, () => new SimpleConfirmationService()); + export const dialogService = define(IDialogService, () => new SimpleDialogService()); export const notificationService = define(INotificationService, () => new SimpleNotificationService()); diff --git a/src/vs/platform/dialogs/common/dialogs.ts b/src/vs/platform/dialogs/common/dialogs.ts index 5a05a12584e85c03c04aaa82a2c2a8ffee497c3e..803d3563db0b428029488f163f241f4651d91cfb 100644 --- a/src/vs/platform/dialogs/common/dialogs.ts +++ b/src/vs/platform/dialogs/common/dialogs.ts @@ -25,7 +25,7 @@ export interface IConfirmationResult { /** * Will be true if the dialog was confirmed with the primary button - * pressed. + * pressed. */ confirmed: boolean; @@ -36,9 +36,9 @@ export interface IConfirmationResult { checkboxChecked?: boolean; } -export const IConfirmationService = createDecorator('confirmationService'); +export const IDialogService = createDecorator('dialogService'); -export interface IConfirmationService { +export interface IDialogService { _serviceBrand: any; diff --git a/src/vs/platform/notification/common/notification.ts b/src/vs/platform/notification/common/notification.ts index 93fa74ef128babc8cd093a5251da0b60f00ef721..56251e78ec7578443cd9043f3b361e37e2513399 100644 --- a/src/vs/platform/notification/common/notification.ts +++ b/src/vs/platform/notification/common/notification.ts @@ -44,7 +44,7 @@ export interface INotification { * close automatically when invoking a secondary action. * * **Note:** If your intent is to show a message with actions to the user, consider - * the `IChoiceService` and `IConfirmationService` instead which are optimized for + * the `IChoiceService` or `IDialogService` instead which are optimized for * this usecase and much easier to use! */ actions?: INotificationActions; @@ -129,7 +129,7 @@ export interface INotificationService { * can be used to control the notification afterwards. * * **Note:** If your intent is to show a message with actions to the user, consider - * the `IChoiceService` and `IConfirmationService` instead which are optimized for + * the `IChoiceService` or `IDialogService` instead which are optimized for * this usecase and much easier to use! */ notify(notification: INotification): INotificationHandle; diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index d6a534a8a1ca97794af352407c5b0803b7980449..90f799ed4f9a32dd00da589472c4e1cd3c7fc781 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -94,7 +94,7 @@ import { WorkbenchIssueService } from 'vs/workbench/services/issue/electron-brow import { INotificationService } from 'vs/platform/notification/common/notification'; import { NotificationService } from 'vs/workbench/services/notification/common/notificationService'; import { ChoiceChannel } from 'vs/platform/dialogs/common/choiceIpc'; -import { IChoiceService, IConfirmationService } from 'vs/platform/dialogs/common/dialogs'; +import { IChoiceService, IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { DialogService } from 'vs/workbench/services/dialogs/electron-browser/dialogs'; /** @@ -409,7 +409,7 @@ export class WorkbenchShell { const dialog = instantiationService.createInstance(DialogService); serviceCollection.set(IChoiceService, dialog); - serviceCollection.set(IConfirmationService, dialog); + serviceCollection.set(IDialogService, dialog); const lifecycleService = instantiationService.createInstance(LifecycleService); this.toUnbind.push(lifecycleService.onShutdown(reason => this.dispose(reason))); diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionProfileService.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionProfileService.ts index 931674a5401cb3290a66ccd3fa601d5c8b3228d8..741fa3f34da077346b29e9110cff25ffa3ae407e 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionProfileService.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionProfileService.ts @@ -17,7 +17,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IExtensionHostProfileService, ProfileSessionState, RuntimeExtensionsInput } from 'vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWindowsService } from 'vs/platform/windows/common/windows'; -import { IConfirmationService } from 'vs/platform/dialogs/common/dialogs'; +import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { randomPort } from 'vs/base/node/ports'; import product from 'vs/platform/node/product'; @@ -43,7 +43,7 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio @IWorkbenchEditorService private readonly _editorService: IWorkbenchEditorService, @IInstantiationService private readonly _instantiationService: IInstantiationService, @IWindowsService private readonly _windowsService: IWindowsService, - @IConfirmationService private readonly _confirmationService: IConfirmationService + @IDialogService private readonly _dialogService: IDialogService ) { super(); this._profile = null; @@ -75,7 +75,7 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio } if (!this._extensionService.canProfileExtensionHost()) { - return this._confirmationService.confirm({ + return this._dialogService.confirm({ type: 'info', message: nls.localize('restart1', "Profile Extensions"), detail: nls.localize('restart2', "In order to profile extensions a restart is required. Do you want to restart '{0}' now?", product.nameLong), diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.ts index a7e0cfe292a23a2ef71cae94b5796622244f4760..e3e74a240b8cf7a77c10cd528be673f87cb949a7 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.ts @@ -51,7 +51,7 @@ import { IListService, ListWidget } from 'vs/platform/list/browser/listService'; import { RawContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { distinctParents, basenameOrAuthority } from 'vs/base/common/resources'; import { Schemas } from 'vs/base/common/network'; -import { IConfirmationService, IConfirmationResult, IConfirmation } from 'vs/platform/dialogs/common/dialogs'; +import { IDialogService, IConfirmationResult, IConfirmation } from 'vs/platform/dialogs/common/dialogs'; import { getConfirmMessage } from 'vs/workbench/services/dialogs/electron-browser/dialogs'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; @@ -566,7 +566,7 @@ class BaseDeleteFileAction extends BaseFileAction { private useTrash: boolean, @IFileService fileService: IFileService, @INotificationService notificationService: INotificationService, - @IConfirmationService private confirmationService: IConfirmationService, + @IDialogService private dialogService: IDialogService, @ITextFileService textFileService: ITextFileService, @IConfigurationService private configurationService: IConfigurationService ) { @@ -611,7 +611,7 @@ class BaseDeleteFileAction extends BaseFileAction { message = nls.localize('dirtyMessageFileDelete', "You are deleting a file with unsaved changes. Do you want to continue?"); } - confirmDirtyPromise = this.confirmationService.confirm({ + confirmDirtyPromise = this.dialogService.confirm({ message, type: 'warning', detail: nls.localize('dirtyWarning', "Your changes will be lost if you don't save them."), @@ -644,7 +644,7 @@ class BaseDeleteFileAction extends BaseFileAction { const message = distinctElements.length > 1 ? getConfirmMessage(nls.localize('confirmMoveTrashMessageMultiple', "Are you sure you want to delete the following {0} files?", distinctElements.length), distinctElements.map(e => e.resource)) : distinctElements[0].isDirectory ? nls.localize('confirmMoveTrashMessageFolder', "Are you sure you want to delete '{0}' and its contents?", distinctElements[0].name) : nls.localize('confirmMoveTrashMessageFile', "Are you sure you want to delete '{0}'?", distinctElements[0].name); - confirmDeletePromise = this.confirmationService.confirm({ + confirmDeletePromise = this.dialogService.confirm({ message, detail: isWindows ? nls.localize('undoBin', "You can restore from the Recycle Bin.") : nls.localize('undoTrash', "You can restore from the Trash."), primaryButton, @@ -660,7 +660,7 @@ class BaseDeleteFileAction extends BaseFileAction { const message = distinctElements.length > 1 ? getConfirmMessage(nls.localize('confirmDeleteMessageMultiple', "Are you sure you want to permanently delete the following {0} files?", distinctElements.length), distinctElements.map(e => e.resource)) : distinctElements[0].isDirectory ? nls.localize('confirmDeleteMessageFolder', "Are you sure you want to permanently delete '{0}' and its contents?", distinctElements[0].name) : nls.localize('confirmDeleteMessageFile', "Are you sure you want to permanently delete '{0}'?", distinctElements[0].name); - confirmDeletePromise = this.confirmationService.confirm({ + confirmDeletePromise = this.dialogService.confirm({ message, detail: nls.localize('irreversible', "This action is irreversible!"), primaryButton, @@ -703,7 +703,7 @@ class BaseDeleteFileAction extends BaseFileAction { primaryButton = nls.localize({ key: 'retryButtonLabel', comment: ['&& denotes a mnemonic'] }, "&&Retry"); } - return this.confirmationService.confirm({ + return this.dialogService.confirm({ message: errorMessage, detail: detailMessage, type: 'warning', @@ -745,7 +745,7 @@ export class ImportFileAction extends BaseFileAction { clazz: string, @IFileService fileService: IFileService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IConfirmationService private confirmationService: IConfirmationService, + @IDialogService private dialogService: IDialogService, @INotificationService notificationService: INotificationService, @ITextFileService textFileService: ITextFileService ) { @@ -798,7 +798,7 @@ export class ImportFileAction extends BaseFileAction { type: 'warning' }; - overwritePromise = this.confirmationService.confirm(confirm); + overwritePromise = this.dialogService.confirm(confirm); } return overwritePromise.then(res => { diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts index 159a026881d03ee9b51b3cc48e0d7090cf05d4fb..863c07840f6aa4c354df38a860aed564420b8cf1 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts @@ -58,7 +58,7 @@ import { DataTransfers } from 'vs/base/browser/dnd'; import { Schemas } from 'vs/base/common/network'; import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces'; import { rtrim } from 'vs/base/common/strings'; -import { IConfirmationService, IConfirmationResult, IConfirmation } from 'vs/platform/dialogs/common/dialogs'; +import { IDialogService, IConfirmationResult, IConfirmation } from 'vs/platform/dialogs/common/dialogs'; import { getConfirmMessage } from 'vs/workbench/services/dialogs/electron-browser/dialogs'; import { INotificationService } from 'vs/platform/notification/common/notification'; @@ -714,7 +714,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { constructor( @INotificationService private notificationService: INotificationService, - @IConfirmationService private confirmationService: IConfirmationService, + @IDialogService private dialogService: IDialogService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @IFileService private fileService: IFileService, @IConfigurationService private configurationService: IConfigurationService, @@ -891,7 +891,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { // If we are in no-workspace context, ask for confirmation to create a workspace let confirmedPromise: TPromise = TPromise.wrap({ confirmed: true }); if (this.contextService.getWorkbenchState() !== WorkbenchState.WORKSPACE) { - confirmedPromise = this.confirmationService.confirm({ + confirmedPromise = this.dialogService.confirm({ message: folders.length > 1 ? nls.localize('dropFolders', "Do you want to add the folders to the workspace?") : nls.localize('dropFolder', "Do you want to add the folder to the workspace?"), type: 'question', primaryButton: folders.length > 1 ? nls.localize('addFolders', "&&Add Folders") : nls.localize('addFolder', "&&Add Folder") @@ -927,7 +927,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { // Handle confirm setting const confirmDragAndDrop = !isCopy && this.configurationService.getValue(FileDragAndDrop.CONFIRM_DND_SETTING_KEY); if (confirmDragAndDrop) { - confirmPromise = this.confirmationService.confirm({ + confirmPromise = this.dialogService.confirm({ message: sources.length > 1 ? getConfirmMessage(nls.localize('confirmMultiMove', "Are you sure you want to move the following {0} files?", sources.length), sources.map(s => s.resource)) : nls.localize('confirmMove', "Are you sure you want to move '{0}'?", sources[0].name), checkbox: { @@ -1053,7 +1053,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { }; // Move with overwrite if the user confirms - return this.confirmationService.confirm(confirm).then(res => { + return this.dialogService.confirm(confirm).then(res => { if (res.confirmed) { const targetDirty = this.textFileService.getDirty().filter(d => resources.isEqualOrParent(d, targetResource, !isLinux /* ignorecase */)); diff --git a/src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts b/src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts index a38b61030533f502919e66dae9b0d9d77450a4f2..1b8c90733cda900161ce881db669daa0d2c0f568 100644 --- a/src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts +++ b/src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts @@ -18,13 +18,13 @@ import { join, dirname } from 'path'; import { localize } from 'vs/nls'; import { readdir, del, readFile } from 'vs/base/node/pfs'; import { basename } from 'vs/base/common/paths'; -import { IConfirmationService } from 'vs/platform/dialogs/common/dialogs'; +import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; class StartupProfiler implements IWorkbenchContribution { constructor( @IWindowsService private readonly _windowsService: IWindowsService, - @IConfirmationService private readonly _confirmationService: IConfirmationService, + @IDialogService private readonly _dialogService: IDialogService, @IEnvironmentService private readonly _environmentService: IEnvironmentService, @IInstantiationService private readonly _instantiationService: IInstantiationService, @ILifecycleService lifecycleService: ILifecycleService, @@ -59,7 +59,7 @@ class StartupProfiler implements IWorkbenchContribution { }).then(files => { const profileFiles = files.reduce((prev, cur) => `${prev}${join(dir, cur)}\n`, '\n'); - return this._confirmationService.confirm({ + return this._dialogService.confirm({ type: 'info', message: localize('prof.message', "Successfully created profiles."), detail: localize('prof.detail', "Please create an issue and manually attach the following files:\n{0}", profileFiles), @@ -73,7 +73,7 @@ class StartupProfiler implements IWorkbenchContribution { action.run(`:warning: Make sure to **attach** these files from your *home*-directory: :warning:\n${files.map(file => `-\`${file}\``).join('\n')}`) ]).then(() => { // keep window stable until restart is selected - return this._confirmationService.confirm({ + return this._dialogService.confirm({ type: 'info', message: localize('prof.thanks', "Thanks for helping us."), detail: localize('prof.detail.restart', "A final restart is required to continue to use '{0}'. Again, thank you for your contribution.", this._environmentService.appNameLong), diff --git a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts index f737a094f3c575e3fbd7565ad51fbe49e17f6be5..9f5b18c4111be0e2b2f2e999eb78e2544158cf24 100644 --- a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts +++ b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts @@ -19,7 +19,7 @@ import URI from 'vs/base/common/uri'; import { isEqual } from 'vs/base/common/resources'; import { isLinux } from 'vs/base/common/platform'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; -import { IConfirmationService } from 'vs/platform/dialogs/common/dialogs'; +import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; interface IConfiguration extends IWindowsConfiguration { update: { channel: string; }; @@ -47,7 +47,7 @@ export class SettingsChangeRelauncher implements IWorkbenchContribution { @IWindowService private windowService: IWindowService, @IConfigurationService private configurationService: IConfigurationService, @IEnvironmentService private envService: IEnvironmentService, - @IConfirmationService private confirmationService: IConfirmationService, + @IDialogService private dialogService: IDialogService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @IExtensionService private extensionService: IExtensionService ) { @@ -146,7 +146,7 @@ export class SettingsChangeRelauncher implements IWorkbenchContribution { private doConfirm(message: string, detail: string, primaryButton: string, confirmed: () => void): void { this.windowService.isFocused().then(focused => { if (focused) { - return this.confirmationService.confirm({ + return this.dialogService.confirm({ type: 'info', message, detail, diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index c01de3bf054cf9a6341d257ab89ff398312cdf80..f5e7e9343024eb3201ed41b1f920b5268163cf94 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -56,7 +56,7 @@ import { isDiffEditor, isCodeEditor, ICodeEditor } from 'vs/editor/browser/edito import { TreeResourceNavigator, WorkbenchTree } from 'vs/platform/list/browser/listService'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { SimpleFileResourceDragAndDrop } from 'vs/workbench/browser/dnd'; -import { IConfirmation, IConfirmationService } from 'vs/platform/dialogs/common/dialogs'; +import { IConfirmation, IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IPanel } from 'vs/workbench/common/panel'; import { IViewlet } from 'vs/workbench/common/viewlet'; @@ -113,7 +113,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { @IEditorGroupService private editorGroupService: IEditorGroupService, @IProgressService private progressService: IProgressService, @INotificationService private notificationService: INotificationService, - @IConfirmationService private confirmationService: IConfirmationService, + @IDialogService private dialogService: IDialogService, @IStorageService private storageService: IStorageService, @IContextViewService private contextViewService: IContextViewService, @IInstantiationService private instantiationService: IInstantiationService, @@ -400,7 +400,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { type: 'question' }; - this.confirmationService.confirm(confirmation).then(res => { + this.dialogService.confirm(confirmation).then(res => { if (res.confirmed) { this.searchWidget.setReplaceAllActionState(false); this.viewModel.searchResult.replaceAll(progressRunner).then(() => { 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 8e1855971638556a7a9cbcd278179ef38e900617..c2acd6caf5ae9e058f9fd951cb9a114789dfeb6d 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -46,7 +46,7 @@ import { IProgressService2, IProgressOptions, ProgressLocation } from 'vs/platfo import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IWindowService } from 'vs/platform/windows/common/windows'; import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IConfirmationService, IChoiceService, IConfirmationResult } from 'vs/platform/dialogs/common/dialogs'; +import { IDialogService, IChoiceService, IConfirmationResult } from 'vs/platform/dialogs/common/dialogs'; import { IModelService } from 'vs/editor/common/services/modelService'; @@ -471,7 +471,7 @@ class TaskService implements ITaskService { @IProgressService2 private progressService: IProgressService2, @IOpenerService private openerService: IOpenerService, @IWindowService private readonly _windowService: IWindowService, - @IConfirmationService private confirmationService: IConfirmationService, + @IDialogService private dialogService: IDialogService, @INotificationService private notificationService: INotificationService, @IChoiceService private choiceService: IChoiceService ) { @@ -1625,7 +1625,7 @@ class TaskService implements ITaskService { if (this._taskSystem.canAutoTerminate()) { terminatePromise = TPromise.wrap({ confirmed: true }); } else { - terminatePromise = this.confirmationService.confirm({ + terminatePromise = this.dialogService.confirm({ message: nls.localize('TaskSystem.runningTask', 'There is a task running. Do you want to terminate it?'), primaryButton: nls.localize({ key: 'TaskSystem.terminateTask', comment: ['&& denotes a mnemonic'] }, "&&Terminate Task"), type: 'question' @@ -1650,7 +1650,7 @@ class TaskService implements ITaskService { this.disposeTaskSystemListeners(); return false; // no veto } else if (code && code === TerminateResponseCode.ProcessNotFound) { - return this.confirmationService.confirm({ + return this.dialogService.confirm({ message: nls.localize('TaskSystem.noProcess', 'The launched task doesn\'t exist anymore. If the task spawned background processes exiting VS Code might result in orphaned processes. To avoid this start the last background process with a wait flag.'), primaryButton: nls.localize({ key: 'TaskSystem.exitAnyways', comment: ['&& denotes a mnemonic'] }, "&&Exit Anyways"), type: 'info' diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts index 5f9e7c6b90d2b5fb493ec92b77ffc9b8df71811f..3994f5ccb26aa4b4113488d325d423b536ab09f7 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts @@ -22,7 +22,7 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag import { getTerminalDefaultShellWindows } from 'vs/workbench/parts/terminal/electron-browser/terminal'; import { TerminalPanel } from 'vs/workbench/parts/terminal/electron-browser/terminalPanel'; import { TerminalTab } from 'vs/workbench/parts/terminal/electron-browser/terminalTab'; -import { IChoiceService, IConfirmationService, Choice } from 'vs/platform/dialogs/common/dialogs'; +import { IChoiceService, IDialogService, Choice } from 'vs/platform/dialogs/common/dialogs'; export class TerminalService extends AbstractTerminalService implements ITerminalService { private _configHelper: TerminalConfigHelper; @@ -43,7 +43,7 @@ export class TerminalService extends AbstractTerminalService implements ITermina @IInstantiationService private readonly _instantiationService: IInstantiationService, @IQuickOpenService private readonly _quickOpenService: IQuickOpenService, @IChoiceService private readonly _choiceService: IChoiceService, - @IConfirmationService private readonly _confirmationService: IConfirmationService + @IDialogService private readonly _dialogService: IDialogService ) { super(contextKeyService, panelService, partService, lifecycleService, storageService); @@ -225,7 +225,7 @@ export class TerminalService extends AbstractTerminalService implements ITermina message = nls.localize('terminalService.terminalCloseConfirmationPlural', "There are {0} active terminal sessions, do you want to kill them?", this.terminalInstances.length); } - return this._confirmationService.confirm({ + return this._dialogService.confirm({ message, type: 'warning', }).then(res => !res.confirmed); diff --git a/src/vs/workbench/services/dialogs/electron-browser/dialogs.ts b/src/vs/workbench/services/dialogs/electron-browser/dialogs.ts index cb25c7f1925dafac7823bd13d521de0facbda9a3..c33af8bfcbe9dcb961b2389f97d05995a83a4d8d 100644 --- a/src/vs/workbench/services/dialogs/electron-browser/dialogs.ts +++ b/src/vs/workbench/services/dialogs/electron-browser/dialogs.ts @@ -13,7 +13,7 @@ import { isLinux, isMacintosh } from 'vs/base/common/platform'; import { Action } from 'vs/base/common/actions'; import { IWindowService } from 'vs/platform/windows/common/windows'; import { mnemonicButtonLabel } from 'vs/base/common/labels'; -import { IConfirmationService, IChoiceService, IConfirmation, IConfirmationResult, Choice } from 'vs/platform/dialogs/common/dialogs'; +import { IDialogService, IChoiceService, IConfirmation, IConfirmationResult, Choice } from 'vs/platform/dialogs/common/dialogs'; import { INotificationService, INotificationHandle, INotificationActions } from 'vs/platform/notification/common/notification'; import { once } from 'vs/base/common/event'; import URI from 'vs/base/common/uri'; @@ -34,7 +34,7 @@ interface IMassagedMessageBoxOptions { buttonIndexMap: number[]; } -export class DialogService implements IChoiceService, IConfirmationService { +export class DialogService implements IChoiceService, IDialogService { public _serviceBrand: any; diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 820b451091d1c8b409609ecb88811123ea510cb9..c72151054a20bd96fab40937dcb9f6edbe398711 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -62,7 +62,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; import { ITextBufferFactory, DefaultEndOfLine, EndOfLinePreference } from 'vs/editor/common/model'; import { Range } from 'vs/editor/common/core/range'; -import { IChoiceService, IConfirmation, IConfirmationResult, IConfirmationService } from 'vs/platform/dialogs/common/dialogs'; +import { IChoiceService, IConfirmation, IConfirmationResult, IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { INotificationService, INotificationHandle, INotification, NoOpNotification } from 'vs/platform/notification/common/notification'; export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput { @@ -333,7 +333,7 @@ export class TestNotificationService implements INotificationService { } } -export class TestConfirmationService implements IConfirmationService { +export class TestDialogService implements IDialogService { public _serviceBrand: any;