@@ -724,82 +724,6 @@ index 18d3d04fd20335975293e37b3b641120dd92da20..a06f20ece490dba5d88b41268cddaaf6
724724 (err: any, socket: ISocket | undefined) => {
725725 if (err || !socket) {
726726 options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`);
727- @@ -331,12 +331,16 @@ export const enum PersistentConnectionEventType {
728- }
729- export class ConnectionLostEvent {
730- public readonly type = PersistentConnectionEventType.ConnectionLost;
731- + constructor(
732- + public readonly connectionAttempt?: number
733- + ) { }
734- }
735- export class ReconnectionWaitEvent {
736- public readonly type = PersistentConnectionEventType.ReconnectionWait;
737- constructor(
738- public readonly durationSeconds: number,
739- - private readonly cancellableTimer: CancelablePromise<void>
740- + private readonly cancellableTimer: CancelablePromise<void>,
741- + public readonly connectionAttempt?: number,
742- ) { }
743-
744- public skipWait(): void {
745- @@ -345,12 +349,21 @@ export class ReconnectionWaitEvent {
746- }
747- export class ReconnectionRunningEvent {
748- public readonly type = PersistentConnectionEventType.ReconnectionRunning;
749- + constructor(
750- + public readonly connectionAttempt?: number
751- + ) { }
752- }
753- export class ConnectionGainEvent {
754- public readonly type = PersistentConnectionEventType.ConnectionGain;
755- + constructor(
756- + public readonly connectionAttempt?: number
757- + ) { }
758- }
759- export class ReconnectionPermanentFailureEvent {
760- public readonly type = PersistentConnectionEventType.ReconnectionPermanentFailure;
761- + constructor(
762- + public readonly connectionAttempt?: number
763- + ) { }
764- }
765- export type PersistenConnectionEvent = ConnectionGainEvent | ConnectionLostEvent | ReconnectionWaitEvent | ReconnectionRunningEvent | ReconnectionPermanentFailureEvent;
766-
767- @@ -411,8 +424,9 @@ abstract class PersistentConnection extends Disposable {
768- }
769- const logPrefix = commonLogPrefix(this._connectionType, this.reconnectionToken, true);
770- this._options.logService.info(`${logPrefix} starting reconnecting loop. You can get more information with the trace log level.`);
771- - this._onDidStateChange.fire(new ConnectionLostEvent());
772- + this._onDidStateChange.fire(new ConnectionLostEvent(0));
773- const TIMES = [5, 5, 10, 10, 10, 10, 10, 30];
774- +
775- const disconnectStartTime = Date.now();
776- let attempt = -1;
777- do {
778- @@ -420,7 +434,7 @@ abstract class PersistentConnection extends Disposable {
779- const waitTime = (attempt < TIMES.length ? TIMES[attempt] : TIMES[TIMES.length - 1]);
780- try {
781- const sleepPromise = sleep(waitTime);
782- - this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise));
783- + this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise, attempt));
784-
785- this._options.logService.info(`${logPrefix} waiting for ${waitTime} seconds before reconnecting...`);
786- try {
787- @@ -433,13 +447,13 @@ abstract class PersistentConnection extends Disposable {
788- }
789-
790- // connection was lost, let's try to re-establish it
791- - this._onDidStateChange.fire(new ReconnectionRunningEvent());
792- + this._onDidStateChange.fire(new ReconnectionRunningEvent(attempt));
793- this._options.logService.info(`${logPrefix} resolving connection...`);
794- const simpleOptions = await resolveConnectionOptions(this._options, this.reconnectionToken, this.protocol);
795- this._options.logService.info(`${logPrefix} connecting to ${simpleOptions.host}:${simpleOptions.port}...`);
796- await connectWithTimeLimit(simpleOptions.logService, this._reconnect(simpleOptions), RECONNECT_TIMEOUT);
797- this._options.logService.info(`${logPrefix} reconnected!`);
798- - this._onDidStateChange.fire(new ConnectionGainEvent());
799- + this._onDidStateChange.fire(new ConnectionGainEvent(attempt));
800-
801- break;
802- } catch (err) {
803727diff --git a/src/vs/platform/storage/browser/storageService.ts b/src/vs/platform/storage/browser/storageService.ts
804728index ab3fd347b69f8a3d9b96e706cd87c911b8ffed6b..9d351037b577f9f1edfd18ae9b3c48a211f4467f 100644
805729--- a/src/vs/platform/storage/browser/storageService.ts
@@ -3929,84 +3853,6 @@ index 94e7e7a4bac154c45078a1b5034e50634a7a43af..8164200dcef1efbc65b50eef9c270af3
39293853 this._filenameKey.set(value ? basename(value) : null);
39303854 this._dirnameKey.set(value ? dirname(value).fsPath : null);
39313855 this._pathKey.set(value ? value.fsPath : null);
3932- diff --git a/src/vs/workbench/contrib/remote/browser/remote.ts b/src/vs/workbench/contrib/remote/browser/remote.ts
3933- index 98573a206f14928fc3fdf18fe927cb75034e4ad1..1430666aa94f941bda086df503fec8b35aa2b25f 100644
3934- --- a/src/vs/workbench/contrib/remote/browser/remote.ts
3935- +++ b/src/vs/workbench/contrib/remote/browser/remote.ts
3936- @@ -730,6 +730,7 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution {
3937- @IContextKeyService contextKeyService: IContextKeyService
3938- ) {
3939- const connection = remoteAgentService.getConnection();
3940- + const SHOW_POPUP_ON_ATTEMPT = 2 // aka third attempt
3941- if (connection) {
3942- let visibleProgress: VisibleProgress | null = null;
3943- let lastLocation: ProgressLocation.Dialog | ProgressLocation.Notification | null = null;
3944- @@ -793,33 +794,47 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution {
3945- disposableListener.dispose();
3946- disposableListener = null;
3947- }
3948- + let suppressPopup = (typeof e.connectionAttempt == 'number' && e.connectionAttempt < SHOW_POPUP_ON_ATTEMPT)
3949- + let forceDialog = (typeof e.connectionAttempt == 'number' && e.connectionAttempt == SHOW_POPUP_ON_ATTEMPT)
3950- switch (e.type) {
3951- case PersistentConnectionEventType.ConnectionLost:
3952- - if (!visibleProgress) {
3953- - visibleProgress = showProgress(ProgressLocation.Dialog, [reconnectButton, reloadButton]);
3954- + if (suppressPopup) {
3955- + hideProgress()
3956- + } else {
3957- + if (!visibleProgress) {
3958- + visibleProgress = showProgress(ProgressLocation.Dialog, [reconnectButton, reloadButton]);
3959- + }
3960- + visibleProgress.report(nls.localize('connectionLost', "Connection Lost"));
3961- }
3962- - visibleProgress.report(nls.localize('connectionLost', "Connection Lost"));
3963- break;
3964- case PersistentConnectionEventType.ReconnectionWait:
3965- reconnectWaitEvent = e;
3966- - visibleProgress = showProgress(lastLocation || ProgressLocation.Notification, [reconnectButton, reloadButton]);
3967- - visibleProgress.startTimer(Date.now() + 1000 * e.durationSeconds);
3968- + if (suppressPopup) {
3969- + hideProgress()
3970- + } else {
3971- + const location = forceDialog ? ProgressLocation.Dialog : (lastLocation || ProgressLocation.Notification)
3972- + visibleProgress = showProgress(location, [reconnectButton, reloadButton]);
3973- + visibleProgress.startTimer(Date.now() + 1000 * e.durationSeconds);
3974- + }
3975- break;
3976- case PersistentConnectionEventType.ReconnectionRunning:
3977- - visibleProgress = showProgress(lastLocation || ProgressLocation.Notification, [reloadButton]);
3978- - visibleProgress.report(nls.localize('reconnectionRunning', "Attempting to reconnect..."));
3979- -
3980- - // Register to listen for quick input is opened
3981- - disposableListener = contextKeyService.onDidChangeContext((contextKeyChangeEvent) => {
3982- - const reconnectInteraction = new Set<string>([inQuickPickContextKeyValue]);
3983- - if (contextKeyChangeEvent.affectsSome(reconnectInteraction)) {
3984- - // Need to move from dialog if being shown and user needs to type in a prompt
3985- - if (lastLocation === ProgressLocation.Dialog && visibleProgress !== null) {
3986- - visibleProgress = showProgress(ProgressLocation.Notification, [reloadButton], visibleProgress.lastReport);
3987- + if (suppressPopup) {
3988- + hideProgress()
3989- + } else {
3990- + visibleProgress = showProgress(lastLocation || ProgressLocation.Notification, [reloadButton]);
3991- + visibleProgress.report(nls.localize('reconnectionRunning', "Attempting to reconnect..."));
3992- +
3993- + // Register to listen for quick input is opened
3994- + disposableListener = contextKeyService.onDidChangeContext((contextKeyChangeEvent) => {
3995- + const reconnectInteraction = new Set<string>([inQuickPickContextKeyValue]);
3996- + if (contextKeyChangeEvent.affectsSome(reconnectInteraction)) {
3997- + // Need to move from dialog if being shown and user needs to type in a prompt
3998- + if (lastLocation === ProgressLocation.Dialog && visibleProgress !== null) {
3999- + visibleProgress = showProgress(ProgressLocation.Notification, [reloadButton], visibleProgress.lastReport);
4000- + }
4001- }
4002- - }
4003- - });
4004- -
4005- + });
4006- + }
4007- break;
4008- case PersistentConnectionEventType.ReconnectionPermanentFailure:
4009- hideProgress();
40103856diff --git a/src/vs/workbench/contrib/scm/browser/media/scm.css b/src/vs/workbench/contrib/scm/browser/media/scm.css
40113857index 74f6922e98b4bb6a7fb100f5aac015afe9fc171b..3243a97c2d378013d96ffbe87e9df6dd4a66776d 100644
40123858--- a/src/vs/workbench/contrib/scm/browser/media/scm.css
0 commit comments