Skip to content

Commit

Permalink
fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Nov 8, 2023
1 parent c86d1ca commit b38ffa1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/vs/base/common/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ type IdleApi = Pick<typeof globalThis, 'requestIdleCallback' | 'cancelIdleCallba
* [requestIdleCallback]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
* [setTimeout]: https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout
*
* **Note** that there is `dom.ts#runWhenWindowIdle` which better suited when running inside a browser
* **Note** that there is `dom.ts#runWhenWindowIdle` which is better suited when running inside a browser
* context
*/
export let runWhenGlobalIdle: (callback: (idle: IdleDeadline) => void, timeout?: number) => IDisposable;
Expand Down Expand Up @@ -1335,7 +1335,7 @@ export abstract class AbstractIdleValue<T> {
/**
* An `IdleValue` that always uses the current window (which might be throttled or inactive)
*
* **Note** that there is `dom.ts#WindowIdleValue` which better suited when running inside a browser
* **Note** that there is `dom.ts#WindowIdleValue` which is better suited when running inside a browser
* context
*/
export class GlobalIdleValue<T> extends AbstractIdleValue<T> {
Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/common/model/textModelTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IdleDeadline, runWhenIdle } from 'vs/base/common/async';
import { IdleDeadline, runWhenGlobalIdle } from 'vs/base/common/async';
import { BugIndicatingError, onUnexpectedError } from 'vs/base/common/errors';
import { setTimeout0 } from 'vs/base/common/platform';
import { StopWatch } from 'vs/base/common/stopwatch';
Expand Down Expand Up @@ -462,7 +462,7 @@ export class DefaultBackgroundTokenizer implements IBackgroundTokenizer {
}

this._isScheduled = true;
runWhenIdle((deadline) => {
runWhenGlobalIdle((deadline) => {
this._isScheduled = false;

this._backgroundTokenizeWithDeadline(deadline);
Expand Down
4 changes: 2 additions & 2 deletions src/vs/platform/storage/common/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { Promises, RunOnceScheduler, runWhenIdle } from 'vs/base/common/async';
import { Promises, RunOnceScheduler, runWhenGlobalIdle } from 'vs/base/common/async';
import { Emitter, Event, PauseableEmitter } from 'vs/base/common/event';
import { Disposable, DisposableStore, dispose, MutableDisposable } from 'vs/base/common/lifecycle';
import { mark } from 'vs/base/common/performance';
Expand Down Expand Up @@ -343,7 +343,7 @@ export abstract class AbstractStorageService extends Disposable implements IStor
}

private doFlushWhenIdle(): void {
this.runFlushWhenIdle.value = runWhenIdle(() => {
this.runFlushWhenIdle.value = runWhenGlobalIdle(() => {
if (this.shouldFlushWhenIdle()) {
this.flush();
}
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/common/contributions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { IInstantiationService, IConstructorSignature, ServicesAccessor, BrandedService } from 'vs/platform/instantiation/common/instantiation';
import { ILifecycleService, LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
import { Registry } from 'vs/platform/registry/common/platform';
import { runWhenIdle, IdleDeadline, DeferredPromise } from 'vs/base/common/async';
import { IdleDeadline, DeferredPromise, runWhenGlobalIdle } from 'vs/base/common/async';
import { mark } from 'vs/base/common/performance';
import { ILogService } from 'vs/platform/log/common/log';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
Expand Down Expand Up @@ -155,7 +155,7 @@ class WorkbenchContributionsRegistry implements IWorkbenchContributionsRegistry
this.safeCreateContribution(instantiationService, logService, environmentService, contribution, phase);
if (idle.timeRemaining() < 1) {
// time is up -> reschedule
runWhenIdle(instantiateSome, forcedTimeout);
runWhenGlobalIdle(instantiateSome, forcedTimeout);
break;
}
}
Expand All @@ -169,7 +169,7 @@ class WorkbenchContributionsRegistry implements IWorkbenchContributionsRegistry
}
};

runWhenIdle(instantiateSome, forcedTimeout);
runWhenGlobalIdle(instantiateSome, forcedTimeout);
}

private safeCreateContribution(instantiationService: IInstantiationService, logService: ILogService, environmentService: IEnvironmentService, contribution: IConstructorSignature<IWorkbenchContribution>, phase: LifecyclePhase): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as osPath from 'vs/base/common/path';
import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent';
import { coalesce } from 'vs/base/common/arrays';
import { DeferredPromise, runWhenIdle } from 'vs/base/common/async';
import { DeferredPromise, runWhenGlobalIdle } from 'vs/base/common/async';
import { decodeBase64 } from 'vs/base/common/buffer';
import { Emitter, Event } from 'vs/base/common/event';
import { getExtensionForMimeType } from 'vs/base/common/mime';
Expand Down Expand Up @@ -1436,7 +1436,7 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Themable {
return;
}

this.pendingWebviewIdleCreationRequest.set(content.source, runWhenIdle(() => {
this.pendingWebviewIdleCreationRequest.set(content.source, runWhenGlobalIdle(() => {
const { message, renderer, transfer: transferable } = this._createOutputCreationMessage(cellInfo, content, cellTop, offset, true, true);
this._sendMessageToWebview(message, transferable);
this.pendingWebviewIdleInsetMapping.set(content.source, { outputId: message.outputId, versionId: content.source.model.versionId, cellInfo: cellInfo, renderer, cachedCreation: message });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { RunOnceScheduler, runWhenIdle } from 'vs/base/common/async';
import { RunOnceScheduler, runWhenGlobalIdle } from 'vs/base/common/async';
import { Emitter, Event } from 'vs/base/common/event';
import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions';
Expand Down Expand Up @@ -60,7 +60,7 @@ export class UserActivityService extends Disposable implements IUserActivityServ

constructor(@IInstantiationService instantiationService: IInstantiationService) {
super();
this._register(runWhenIdle(() => userActivityRegistry.take(this, instantiationService)));
this._register(runWhenGlobalIdle(() => userActivityRegistry.take(this, instantiationService)));
}

/** @inheritdoc */
Expand Down

0 comments on commit b38ffa1

Please sign in to comment.