Revert "Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)" (#5983)

This reverts commit d15a3fcc98.
This commit is contained in:
Karl Burtram
2019-06-11 12:35:58 -07:00
committed by GitHub
parent 95a50b7892
commit 5a7562a37b
926 changed files with 11394 additions and 19540 deletions

View File

@@ -4,10 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import BaseSeverity from 'vs/base/common/severity';
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IAction } from 'vs/base/common/actions';
import { Event, Emitter } from 'vs/base/common/event';
import { IDisposable } from 'vs/base/common/lifecycle';
export import Severity = BaseSeverity;
@@ -70,14 +69,14 @@ export interface INotificationActions {
* Primary actions show up as buttons as part of the message and will close
* the notification once clicked.
*/
primary?: ReadonlyArray<IAction>;
primary?: IAction[];
/**
* Secondary actions are meant to provide additional configuration or context
* for the notification and will show up less prominent. A notification does not
* close automatically when invoking a secondary action.
*/
secondary?: ReadonlyArray<IAction>;
secondary?: IAction[];
}
export interface INotificationProgress {
@@ -173,21 +172,6 @@ export interface IPromptOptions extends INotificationProperties {
onCancel?: () => void;
}
export interface IStatusMessageOptions {
/**
* An optional timeout after which the status message should show. By default
* the status message will show immediately.
*/
showAfter?: number;
/**
* An optional timeout after which the status message is to be hidden. By default
* the status message will not hide until another status message is displayed.
*/
hideAfter?: number;
}
/**
* A service to bring up notifications and non-modal prompts.
*
@@ -195,7 +179,7 @@ export interface IStatusMessageOptions {
*/
export interface INotificationService {
_serviceBrand: ServiceIdentifier<INotificationService>;
_serviceBrand: any;
/**
* Show the provided notification to the user. The returned `INotificationHandle`
@@ -237,24 +221,16 @@ 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[], options?: IPromptOptions): INotificationHandle;
/**
* Shows a status message in the status area with the provied text.
*
* @param message the message to show as status
* @param options provides some optional configuration options
*
* @returns a disposable to hide the status message
*/
status(message: NotificationMessage, options?: IStatusMessageOptions): IDisposable;
}
export class NoOpNotification implements INotificationHandle {
readonly progress = new NoOpProgress();
private readonly _onDidClose: Emitter<void> = new Emitter();
get onDidClose(): Event<void> { return this._onDidClose.event; }
get onDidClose(): Event<void> {
return this._onDidClose.event;
}
updateSeverity(severity: Severity): void { }
updateMessage(message: NotificationMessage): void { }

View File

@@ -3,36 +3,31 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { INotificationService, INotificationHandle, NoOpNotification, Severity, INotification, IPromptChoice, IPromptOptions, IStatusMessageOptions } from 'vs/platform/notification/common/notification';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { INotificationService, INotificationHandle, NoOpNotification, Severity, INotification, IPromptChoice, IPromptOptions } from 'vs/platform/notification/common/notification';
export class TestNotificationService implements INotificationService {
_serviceBrand: any;
public _serviceBrand: any;
private static readonly NO_OP: INotificationHandle = new NoOpNotification();
info(message: string): INotificationHandle {
public info(message: string): INotificationHandle {
return this.notify({ severity: Severity.Info, message });
}
warn(message: string): INotificationHandle {
public warn(message: string): INotificationHandle {
return this.notify({ severity: Severity.Warning, message });
}
error(error: string | Error): INotificationHandle {
public error(error: string | Error): INotificationHandle {
return this.notify({ severity: Severity.Error, message: error });
}
notify(notification: INotification): INotificationHandle {
public notify(notification: INotification): INotificationHandle {
return TestNotificationService.NO_OP;
}
prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle {
public prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle {
return TestNotificationService.NO_OP;
}
status(message: string | Error, options?: IStatusMessageOptions): IDisposable {
return Disposable.None;
}
}