Skip to content

Commit

Permalink
Activate extensions after timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceerhl committed Jan 20, 2023
1 parent 1456180 commit 891a9e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/vs/workbench/api/common/extHostExtensionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as nls from 'vs/nls';
import * as path from 'vs/base/common/path';
import * as performance from 'vs/base/common/performance';
import { originalFSPath, joinPath, extUriBiasedIgnorePathCase } from 'vs/base/common/resources';
import { asPromise, Barrier, IntervalTimer, runWhenIdle, timeout } from 'vs/base/common/async';
import { asPromise, Barrier, IntervalTimer, timeout } from 'vs/base/common/async';
import { dispose, toDisposable, Disposable } from 'vs/base/common/lifecycle';
import { TernarySearchTree } from 'vs/base/common/ternarySearchTree';
import { URI, UriComponents } from 'vs/base/common/uri';
Expand Down Expand Up @@ -42,6 +42,7 @@ import { Schemas } from 'vs/base/common/network';
import { IResolveAuthorityResult } from 'vs/workbench/services/extensions/common/extensionHostProxy';
import { IExtHostLocalizationService } from 'vs/workbench/api/common/extHostLocalizationService';
import { StopWatch } from 'vs/base/common/stopwatch';
import { setTimeout0 } from 'vs/base/common/platform';

interface ITestRunner {
/** Old test runner API, as exported from `vscode/lib/testrunner` */
Expand Down Expand Up @@ -605,7 +606,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
for (const activationEvent of desc.activationEvents) {
if (activationEvent === 'onStartupFinished') {
if (shouldDeferActivation) {
this._register(runWhenIdle(() => this._activateOneStartupFinished(desc, activationEvent)));
setTimeout0(() => this._activateOneStartupFinished(desc, activationEvent));
} else {
this._activateOneStartupFinished(desc, activationEvent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
},
'extensions.experimental.deferredStartupFinishedActivation': {
type: 'boolean',
description: localize('extensionsDeferredStartupFinishedActivation', "When enabled, extensions which declare the `onStartupFinished` activation event will be activated using idle callbacks."),
description: localize('extensionsDeferredStartupFinishedActivation', "When enabled, extensions which declare the `onStartupFinished` activation event will be activated after a timeout."),
default: false
}
}
Expand Down

0 comments on commit 891a9e5

Please sign in to comment.