mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-27 21:52:59 +00:00
Reorder eager extension activation (#176706)
* Handle all pending operations right after opening barrier --------- Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
This commit is contained in:
@@ -193,6 +193,14 @@ export class ExtensionsActivator implements IDisposable {
|
||||
}
|
||||
}
|
||||
|
||||
public async waitForActivatingExtensions(): Promise<void> {
|
||||
const res: Promise<boolean>[] = [];
|
||||
for (const [_, op] of this._operations) {
|
||||
res.push(op.wait());
|
||||
}
|
||||
await Promise.all(res);
|
||||
}
|
||||
|
||||
public isActivated(extensionId: ExtensionIdentifier): boolean {
|
||||
const op = this._operations.get(extensionId);
|
||||
return Boolean(op && op.value);
|
||||
|
||||
@@ -756,6 +756,10 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
|
||||
|
||||
return this._readyToStartExtensionHost.wait()
|
||||
.then(() => this._readyToRunExtensions.open())
|
||||
.then(() => {
|
||||
// wait for all activation events that came in during workbench startup, but at maximum 1s
|
||||
return Promise.race([this._activator.waitForActivatingExtensions(), timeout(1000)]);
|
||||
})
|
||||
.then(() => this._handleEagerExtensions())
|
||||
.then(() => {
|
||||
this._eagerExtensionsActivated.open();
|
||||
|
||||
Reference in New Issue
Block a user