mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 01:25:39 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -5,13 +5,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import BaseSeverity from 'vs/base/common/severity';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
|
||||
export import Severity = Severity;
|
||||
export import Severity = BaseSeverity;
|
||||
|
||||
export const INotificationService = createDecorator<INotificationService>('notificationService');
|
||||
|
||||
@@ -44,7 +43,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 `INotificationService.prompt()` method instead which are optimized for
|
||||
* this usecase and much easier to use!
|
||||
*/
|
||||
actions?: INotificationActions;
|
||||
@@ -150,6 +149,11 @@ export interface IPromptChoice {
|
||||
run: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* A service to bring up notifications and non-modal prompts.
|
||||
*
|
||||
* Note: use the `IDialogService` for a modal way to ask the user for input.
|
||||
*/
|
||||
export interface INotificationService {
|
||||
|
||||
_serviceBrand: any;
|
||||
@@ -159,8 +163,10 @@ 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 `INotificationService.prompt()` method instead which are optimized for
|
||||
* this usecase and much easier to use!
|
||||
*
|
||||
* @returns a handle on the notification to e.g. hide it or update message, buttons, etc.
|
||||
*/
|
||||
notify(notification: INotification): INotificationHandle;
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { INotificationService, INotificationHandle, NoOpNotification, Severity, INotification, IPromptChoice } from 'vs/platform/notification/common/notification';
|
||||
|
||||
export class TestNotificationService implements INotificationService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
private static readonly NO_OP: INotificationHandle = new NoOpNotification();
|
||||
|
||||
public info(message: string): INotificationHandle {
|
||||
return this.notify({ severity: Severity.Info, message });
|
||||
}
|
||||
|
||||
public warn(message: string): INotificationHandle {
|
||||
return this.notify({ severity: Severity.Warning, message });
|
||||
}
|
||||
|
||||
public error(error: string | Error): INotificationHandle {
|
||||
return this.notify({ severity: Severity.Error, message: error });
|
||||
}
|
||||
|
||||
public notify(notification: INotification): INotificationHandle {
|
||||
return TestNotificationService.NO_OP;
|
||||
}
|
||||
|
||||
public prompt(severity: Severity, message: string, choices: IPromptChoice[], onCancel?: () => void): INotificationHandle {
|
||||
return TestNotificationService.NO_OP;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user