Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import BaseSeverity from 'vs/base/common/severity';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IAction } from 'vs/base/common/actions';
@@ -16,7 +14,23 @@ export const INotificationService = createDecorator<INotificationService>('notif
export type NotificationMessage = string | Error;
export interface INotification {
export interface INotificationProperties {
/**
* Sticky notifications are not automatically removed after a certain timeout. By
* default, notifications with primary actions and severity error are always sticky.
*/
sticky?: boolean;
/**
* Silent notifications are not shown to the user unless the notification center
* is opened. The status bar will still indicate all number of notifications to
* catch some attention.
*/
silent?: boolean;
}
export interface INotification extends INotificationProperties {
/**
* The severity of the notification. Either `Info`, `Warning` or `Error`.
@@ -149,6 +163,15 @@ export interface IPromptChoice {
run: () => void;
}
export interface IPromptOptions extends INotificationProperties {
/**
* Will be called if the user closed the notification without picking
* any of the provided choices.
*/
onCancel?: () => void;
}
/**
* A service to bring up notifications and non-modal prompts.
*
@@ -197,7 +220,7 @@ export interface INotificationService {
*
* @returns a handle on the notification to e.g. hide it or update message, buttons, etc.
*/
prompt(severity: Severity, message: string, choices: IPromptChoice[], onCancel?: () => void): INotificationHandle;
prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle;
}
export class NoOpNotification implements INotificationHandle {

View File

@@ -2,9 +2,8 @@
* 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';
import { INotificationService, INotificationHandle, NoOpNotification, Severity, INotification, IPromptChoice, IPromptOptions } from 'vs/platform/notification/common/notification';
export class TestNotificationService implements INotificationService {
@@ -28,7 +27,7 @@ export class TestNotificationService implements INotificationService {
return TestNotificationService.NO_OP;
}
public prompt(severity: Severity, message: string, choices: IPromptChoice[], onCancel?: () => void): INotificationHandle {
public prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle {
return TestNotificationService.NO_OP;
}
}