Merge from vscode 10492ba146318412cbee8b76a8c630f226914734

This commit is contained in:
ADS Merger
2020-04-08 06:33:38 +00:00
parent fca2344c2e
commit 1868a7d370
339 changed files with 3795 additions and 3146 deletions

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Event, Emitter } from 'vs/base/common/event';
import { Emitter } from 'vs/base/common/event';
import { Barrier } from 'vs/base/common/async';
import { Disposable } from 'vs/base/common/lifecycle';
import { ILifecycleService, BeforeShutdownEvent, WillShutdownEvent, StartupKind, LifecyclePhase, LifecyclePhaseToString } from 'vs/platform/lifecycle/common/lifecycle';
@@ -15,13 +15,13 @@ export abstract class AbstractLifecycleService extends Disposable implements ILi
_serviceBrand: undefined;
protected readonly _onBeforeShutdown = this._register(new Emitter<BeforeShutdownEvent>());
readonly onBeforeShutdown: Event<BeforeShutdownEvent> = this._onBeforeShutdown.event;
readonly onBeforeShutdown = this._onBeforeShutdown.event;
protected readonly _onWillShutdown = this._register(new Emitter<WillShutdownEvent>());
readonly onWillShutdown: Event<WillShutdownEvent> = this._onWillShutdown.event;
readonly onWillShutdown = this._onWillShutdown.event;
protected readonly _onShutdown = this._register(new Emitter<void>());
readonly onShutdown: Event<void> = this._onShutdown.event;
readonly onShutdown = this._onShutdown.event;
protected _startupKind: StartupKind = StartupKind.NewWindow;
get startupKind(): StartupKind { return this._startupKind; }
@@ -29,7 +29,7 @@ export abstract class AbstractLifecycleService extends Disposable implements ILi
private _phase: LifecyclePhase = LifecyclePhase.Starting;
get phase(): LifecyclePhase { return this._phase; }
private phaseWhen = new Map<LifecyclePhase, Barrier>();
private readonly phaseWhen = new Map<LifecyclePhase, Barrier>();
constructor(
@ILogService protected readonly logService: ILogService

View File

@@ -13,7 +13,7 @@ import { handleVetos } from 'vs/platform/lifecycle/common/lifecycle';
import { isMacintosh, isWindows } from 'vs/base/common/platform';
import { Disposable } from 'vs/base/common/lifecycle';
import { Barrier, timeout } from 'vs/base/common/async';
import { ParsedArgs } from 'vs/platform/environment/common/environment';
import { ParsedArgs } from 'vs/platform/environment/node/argv';
export const ILifecycleMainService = createDecorator<ILifecycleMainService>('lifecycleMainService');
@@ -141,7 +141,28 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe
private static readonly QUIT_FROM_RESTART_MARKER = 'quit.from.restart'; // use a marker to find out if the session was restarted
private windowToCloseRequest: Set<number> = new Set();
private readonly _onBeforeShutdown = this._register(new Emitter<void>());
readonly onBeforeShutdown = this._onBeforeShutdown.event;
private readonly _onWillShutdown = this._register(new Emitter<ShutdownEvent>());
readonly onWillShutdown = this._onWillShutdown.event;
private readonly _onBeforeWindowClose = this._register(new Emitter<ICodeWindow>());
readonly onBeforeWindowClose = this._onBeforeWindowClose.event;
private readonly _onBeforeWindowUnload = this._register(new Emitter<IWindowUnloadEvent>());
readonly onBeforeWindowUnload = this._onBeforeWindowUnload.event;
private _quitRequested = false;
get quitRequested(): boolean { return this._quitRequested; }
private _wasRestarted: boolean = false;
get wasRestarted(): boolean { return this._wasRestarted; }
private _phase = LifecycleMainPhase.Starting;
get phase(): LifecycleMainPhase { return this._phase; }
private readonly windowToCloseRequest = new Set<number>();
private oneTimeListenerTokenGenerator = 0;
private windowCounter = 0;
@@ -150,28 +171,7 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe
private pendingWillShutdownPromise: Promise<void> | null = null;
private _quitRequested = false;
get quitRequested(): boolean { return this._quitRequested; }
private _wasRestarted: boolean = false;
get wasRestarted(): boolean { return this._wasRestarted; }
private readonly _onBeforeShutdown = this._register(new Emitter<void>());
readonly onBeforeShutdown: Event<void> = this._onBeforeShutdown.event;
private readonly _onWillShutdown = this._register(new Emitter<ShutdownEvent>());
readonly onWillShutdown: Event<ShutdownEvent> = this._onWillShutdown.event;
private readonly _onBeforeWindowClose = this._register(new Emitter<ICodeWindow>());
readonly onBeforeWindowClose: Event<ICodeWindow> = this._onBeforeWindowClose.event;
private readonly _onBeforeWindowUnload = this._register(new Emitter<IWindowUnloadEvent>());
readonly onBeforeWindowUnload: Event<IWindowUnloadEvent> = this._onBeforeWindowUnload.event;
private _phase: LifecycleMainPhase = LifecycleMainPhase.Starting;
get phase(): LifecycleMainPhase { return this._phase; }
private phaseWhen = new Map<LifecycleMainPhase, Barrier>();
private readonly phaseWhen = new Map<LifecycleMainPhase, Barrier>();
constructor(
@ILogService private readonly logService: ILogService,