Skip to content

Commit d2e6222

Browse files
authored
Revert "remove EH start delay" (microsoft#175315)
This reverts commit 21718a1. re microsoft#175275 This change is still good but changes how/what we measure and we should do that with more slack time
1 parent ba158c8 commit d2e6222

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { CachedExtensionScanner } from 'vs/workbench/services/extensions/electro
77
import { AbstractExtensionService, ExtensionHostCrashTracker, ExtensionRunningPreference, extensionRunningPreferenceToString, filterByRunningLocation } from 'vs/workbench/services/extensions/common/abstractExtensionService';
88
import * as nls from 'vs/nls';
99
import * as performance from 'vs/base/common/performance';
10+
import { runWhenIdle } from 'vs/base/common/async';
1011
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
1112
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
1213
import { IWorkbenchExtensionEnablementService, EnablementState, IWorkbenchExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
@@ -116,7 +117,12 @@ export class NativeExtensionService extends AbstractExtensionService implements
116117
// some editors require the extension host to restore
117118
// and this would result in a deadlock
118119
// see https://github.com/microsoft/vscode/issues/41322
119-
lifecycleService.when(LifecyclePhase.Ready).then(() => this._initialize());
120+
lifecycleService.when(LifecyclePhase.Ready).then(() => {
121+
// reschedule to ensure this runs after restoring viewlets, panels, and editors
122+
runWhenIdle(() => {
123+
this._initialize();
124+
}, 50 /*max delay*/);
125+
});
120126
}
121127

122128
private _isLocalWebWorkerEnabled(): [boolean, boolean] {

0 commit comments

Comments
 (0)