@@ -689,7 +689,7 @@ index 3715cbb8e6ee41c3d9b5090918d243b723ae2d00..c65de8ad37e727d66da97a8f8b170cbc
689
689
-
690
690
-
691
691
diff --git a/src/vs/platform/remote/common/remoteAgentConnection.ts b/src/vs/platform/remote/common/remoteAgentConnection.ts
692
- index 18d3d04fd20335975293e37b3b641120dd92da20..ddc85643fc414991bf885f099f982d9de1b9eae2 100644
692
+ index 18d3d04fd20335975293e37b3b641120dd92da20..4ec77056f8b707cb9cfc6af28f995d644b127506 100644
693
693
--- a/src/vs/platform/remote/common/remoteAgentConnection.ts
694
694
+++ b/src/vs/platform/remote/common/remoteAgentConnection.ts
695
695
@@ -92,7 +92,7 @@ async function connectToRemoteExtensionHostAgent(options: ISimpleConnectionOptio
@@ -701,7 +701,7 @@ index 18d3d04fd20335975293e37b3b641120dd92da20..ddc85643fc414991bf885f099f982d9d
701
701
(err: any, socket: ISocket | undefined) => {
702
702
if (err || !socket) {
703
703
options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`);
704
- @@ -331,12 +331,16 @@ export const enum PersistentConnectionEventType {
704
+ @@ -331,12 +331,17 @@ export const enum PersistentConnectionEventType {
705
705
}
706
706
export class ConnectionLostEvent {
707
707
public readonly type = PersistentConnectionEventType.ConnectionLost;
@@ -715,11 +715,12 @@ index 18d3d04fd20335975293e37b3b641120dd92da20..ddc85643fc414991bf885f099f982d9d
715
715
public readonly durationSeconds: number,
716
716
- private readonly cancellableTimer: CancelablePromise<void>
717
717
+ private readonly cancellableTimer: CancelablePromise<void>,
718
- + public readonly suppressPopup?: boolean
718
+ + public readonly suppressPopup?: boolean,
719
+ + public readonly forceDialog?: boolean
719
720
) { }
720
721
721
722
public skipWait(): void {
722
- @@ -345,12 +349 ,21 @@ export class ReconnectionWaitEvent {
723
+ @@ -345,12 +350 ,21 @@ export class ReconnectionWaitEvent {
723
724
}
724
725
export class ReconnectionRunningEvent {
725
726
public readonly type = PersistentConnectionEventType.ReconnectionRunning;
@@ -741,30 +742,33 @@ index 18d3d04fd20335975293e37b3b641120dd92da20..ddc85643fc414991bf885f099f982d9d
741
742
}
742
743
export type PersistenConnectionEvent = ConnectionGainEvent | ConnectionLostEvent | ReconnectionWaitEvent | ReconnectionRunningEvent | ReconnectionPermanentFailureEvent;
743
744
744
- @@ -411,16 +424,20 @@ abstract class PersistentConnection extends Disposable {
745
+ @@ -411,16 +425,22 @@ abstract class PersistentConnection extends Disposable {
745
746
}
746
747
const logPrefix = commonLogPrefix(this._connectionType, this.reconnectionToken, true);
747
748
this._options.logService.info(`${logPrefix} starting reconnecting loop. You can get more information with the trace log level.`);
748
749
- this._onDidStateChange.fire(new ConnectionLostEvent());
750
+ - const TIMES = [5, 5, 10, 10, 10, 10, 10, 30];
749
751
+ let suppressPopup = true;
752
+ + let forceDialog = false;
750
753
+ this._onDidStateChange.fire(new ConnectionLostEvent(suppressPopup));
751
- const TIMES = [5, 5, 10 , 10, 10, 10, 10, 30];
754
+ + const TIMES = [1, 2, 3 , 10, 10, 10, 10, 30];
752
755
+ const SHOW_POPUP_ON_ATTEMPT = 2 // aka third attempt
753
756
+
754
757
const disconnectStartTime = Date.now();
755
758
let attempt = -1;
756
759
do {
757
760
attempt++;
758
761
+ suppressPopup = (attempt < SHOW_POPUP_ON_ATTEMPT) ? true : false
762
+ + forceDialog = (attempt == SHOW_POPUP_ON_ATTEMPT)
759
763
const waitTime = (attempt < TIMES.length ? TIMES[attempt] : TIMES[TIMES.length - 1]);
760
764
try {
761
765
const sleepPromise = sleep(waitTime);
762
766
- this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise));
763
- + this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise, suppressPopup));
767
+ + this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise, suppressPopup, forceDialog ));
764
768
765
769
this._options.logService.info(`${logPrefix} waiting for ${waitTime} seconds before reconnecting...`);
766
770
try {
767
- @@ -433,7 +450 ,7 @@ abstract class PersistentConnection extends Disposable {
771
+ @@ -433,7 +453 ,7 @@ abstract class PersistentConnection extends Disposable {
768
772
}
769
773
770
774
// connection was lost, let's try to re-establish it
@@ -3272,84 +3276,71 @@ index 94e7e7a4bac154c45078a1b5034e50634a7a43af..8164200dcef1efbc65b50eef9c270af3
3272
3276
this._dirnameKey.set(value ? dirname(value).fsPath : null);
3273
3277
this._pathKey.set(value ? value.fsPath : null);
3274
3278
diff --git a/src/vs/workbench/contrib/remote/browser/remote.ts b/src/vs/workbench/contrib/remote/browser/remote.ts
3275
- index 98573a206f14928fc3fdf18fe927cb75034e4ad1..3ffe27b816e2d0a630985a24dd1af910877c2295 100644
3279
+ index 98573a206f14928fc3fdf18fe927cb75034e4ad1..a031f76924abf8f10c510ea9c043f670c5b43074 100644
3276
3280
--- a/src/vs/workbench/contrib/remote/browser/remote.ts
3277
3281
+++ b/src/vs/workbench/contrib/remote/browser/remote.ts
3278
- @@ -635,7 +635,7 @@ class VisibleProgress {
3279
- return this._lastReport;
3280
- }
3281
-
3282
- - constructor(progressService: IProgressService, location: ProgressLocation, initialReport: string | null, buttons: string[], onDidCancel: (choice: number | undefined, lastReport: string | null) => void) {
3283
- + constructor(progressService: IProgressService, location: ProgressLocation, initialReport: string | null, buttons: string[], onDidCancel: (choice: number | undefined, lastReport: string | null) => void, suppressPopup: Boolean | undefined) {
3284
- this._isDisposed = false;
3285
- this._lastReport = initialReport;
3286
- this._currentProgressPromiseResolve = null;
3287
- @@ -644,8 +644,10 @@ class VisibleProgress {
3288
-
3289
- const promise = new Promise<void>((resolve) => this._currentProgressPromiseResolve = resolve);
3290
-
3291
- + const options = suppressPopup ? { location: location, buttons: buttons, silent: suppressPopup } : { location: location, buttons: buttons }
3292
- +
3293
- progressService.withProgress(
3294
- - { location: location, buttons: buttons },
3295
- + options,
3296
- (progress) => { if (!this._isDisposed) { this._currentProgress = progress; } return promise; },
3297
- (choice) => onDidCancel(choice, this._lastReport)
3298
- );
3299
- @@ -736,7 +738,7 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution {
3300
- let reconnectWaitEvent: ReconnectionWaitEvent | null = null;
3301
- let disposableListener: IDisposable | null = null;
3302
-
3303
- - function showProgress(location: ProgressLocation.Dialog | ProgressLocation.Notification, buttons: { label: string, callback: () => void }[], initialReport: string | null = null): VisibleProgress {
3304
- + function showProgress(location: ProgressLocation.Dialog | ProgressLocation.Notification, buttons: { label: string, callback: () => void }[], initialReport: string | null = null, suppressPopup: Boolean | undefined): VisibleProgress {
3305
- if (visibleProgress) {
3306
- visibleProgress.dispose();
3307
- visibleProgress = null;
3308
- @@ -752,12 +754,12 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution {
3309
- buttons[choice].callback();
3310
- } else {
3311
- if (location === ProgressLocation.Dialog) {
3312
- - visibleProgress = showProgress(ProgressLocation.Notification, buttons, lastReport);
3313
- + visibleProgress = showProgress(ProgressLocation.Notification, buttons, lastReport, suppressPopup);
3314
- } else {
3315
- hideProgress();
3316
- }
3317
- }
3318
- - }
3319
- + }, suppressPopup
3320
- );
3321
- }
3322
-
3323
- @@ -796,17 +798,17 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution {
3282
+ @@ -795,31 +795,43 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution {
3283
+ }
3324
3284
switch (e.type) {
3325
3285
case PersistentConnectionEventType.ConnectionLost:
3326
- if (!visibleProgress) {
3286
+ - if (!visibleProgress) {
3327
3287
- visibleProgress = showProgress(ProgressLocation.Dialog, [reconnectButton, reloadButton]);
3328
- + visibleProgress = showProgress(ProgressLocation.Notification, [reconnectButton, reloadButton], null, e.suppressPopup);
3288
+ + if (e.suppressPopup) {
3289
+ + hideProgress()
3290
+ + } else {
3291
+ + if (!visibleProgress) {
3292
+ + visibleProgress = showProgress(ProgressLocation.Dialog, [reconnectButton, reloadButton]);
3293
+ + }
3294
+ + visibleProgress.report(nls.localize('connectionLost', "Connection Lost"));
3329
3295
}
3330
- visibleProgress.report(nls.localize('connectionLost', "Connection Lost"));
3296
+ - visibleProgress.report(nls.localize('connectionLost', "Connection Lost"));
3331
3297
break;
3332
3298
case PersistentConnectionEventType.ReconnectionWait:
3333
3299
reconnectWaitEvent = e;
3334
3300
- visibleProgress = showProgress(lastLocation || ProgressLocation.Notification, [reconnectButton, reloadButton]);
3335
- + visibleProgress = showProgress(lastLocation || ProgressLocation.Dialog, [reconnectButton, reloadButton], null, e.suppressPopup);
3336
- visibleProgress.startTimer(Date.now() + 1000 * e.durationSeconds);
3301
+ - visibleProgress.startTimer(Date.now() + 1000 * e.durationSeconds);
3302
+ + if (e.suppressPopup) {
3303
+ + hideProgress()
3304
+ + } else {
3305
+ + const location = e.forceDialog ? ProgressLocation.Dialog : (lastLocation || ProgressLocation.Notification)
3306
+ + visibleProgress = showProgress(location, [reconnectButton, reloadButton]);
3307
+ + visibleProgress.startTimer(Date.now() + 1000 * e.durationSeconds);
3308
+ + }
3337
3309
break;
3338
3310
case PersistentConnectionEventType.ReconnectionRunning:
3339
3311
- visibleProgress = showProgress(lastLocation || ProgressLocation.Notification, [reloadButton]);
3340
- + visibleProgress = showProgress(lastLocation || ProgressLocation.Notification, [reloadButton], null, e.suppressPopup );
3341
- visibleProgress.report(nls.localize('reconnectionRunning', "Attempting to reconnect..."));
3342
-
3343
- // Register to listen for quick input is opened
3344
- @@ -815,7 +817,7 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution {
3345
- if (contextKeyChangeEvent.affectsSome(reconnectInteraction)) {
3346
- // Need to move from dialog if being shown and user needs to type in a prompt
3347
- if (lastLocation === ProgressLocation.Dialog && visibleProgress !== null) {
3312
+ - visibleProgress.report(nls.localize('reconnectionRunning', "Attempting to reconnect...") );
3313
+ -
3314
+ - // Register to listen for quick input is opened
3315
+ - disposableListener = contextKeyService.onDidChangeContext((contextKeyChangeEvent) => {
3316
+ - const reconnectInteraction = new Set<string>([inQuickPickContextKeyValue]);
3317
+ - if (contextKeyChangeEvent.affectsSome(reconnectInteraction)) {
3318
+ - // Need to move from dialog if being shown and user needs to type in a prompt
3319
+ - if (lastLocation === ProgressLocation.Dialog && visibleProgress !== null) {
3348
3320
- visibleProgress = showProgress(ProgressLocation.Notification, [reloadButton], visibleProgress.lastReport);
3349
- + visibleProgress = showProgress(ProgressLocation.Notification, [reloadButton], visibleProgress.lastReport, e.suppressPopup);
3321
+ + if (e.suppressPopup) {
3322
+ + hideProgress()
3323
+ + } else {
3324
+ + visibleProgress = showProgress(lastLocation || ProgressLocation.Notification, [reloadButton]);
3325
+ + visibleProgress.report(nls.localize('reconnectionRunning', "Attempting to reconnect..."));
3326
+ +
3327
+ + // Register to listen for quick input is opened
3328
+ + disposableListener = contextKeyService.onDidChangeContext((contextKeyChangeEvent) => {
3329
+ + const reconnectInteraction = new Set<string>([inQuickPickContextKeyValue]);
3330
+ + if (contextKeyChangeEvent.affectsSome(reconnectInteraction)) {
3331
+ + // Need to move from dialog if being shown and user needs to type in a prompt
3332
+ + if (lastLocation === ProgressLocation.Dialog && visibleProgress !== null) {
3333
+ + visibleProgress = showProgress(ProgressLocation.Notification, [reloadButton], visibleProgress.lastReport);
3334
+ + }
3350
3335
}
3351
- }
3352
- });
3336
+ - }
3337
+ - });
3338
+ -
3339
+ + });
3340
+ + }
3341
+ break;
3342
+ case PersistentConnectionEventType.ReconnectionPermanentFailure:
3343
+ hideProgress();
3353
3344
diff --git a/src/vs/workbench/contrib/scm/browser/media/scm.css b/src/vs/workbench/contrib/scm/browser/media/scm.css
3354
3345
index ac44ad3bae428def66e22fe9cc1c54648d429f6b..faa63023c4c586b51fa3c2a48ff3641b9cb0e145 100644
3355
3346
--- a/src/vs/workbench/contrib/scm/browser/media/scm.css
0 commit comments