Skip to content

Commit 68ff54f

Browse files
committed
rename RunOnceScheduler#timeout to delay
1 parent 90a2bed commit 68ff54f

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/vs/base/common/async.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -614,15 +614,15 @@ export class RunOnceScheduler {
614614

615615
protected runner: ((...args: any[]) => void) | null;
616616

617-
private _timeoutToken: any;
618-
private _timeout: number;
619-
private _timeoutHandler: () => void;
617+
private timeoutToken: any;
618+
private timeout: number;
619+
private timeoutHandler: () => void;
620620

621-
constructor(runner: (...args: any[]) => void, timeout: number) {
622-
this._timeoutToken = -1;
621+
constructor(runner: (...args: any[]) => void, delay: number) {
622+
this.timeoutToken = -1;
623623
this.runner = runner;
624-
this._timeout = timeout;
625-
this._timeoutHandler = this.onTimeout.bind(this);
624+
this.timeout = delay;
625+
this.timeoutHandler = this.onTimeout.bind(this);
626626
}
627627

628628
/**
@@ -638,36 +638,36 @@ export class RunOnceScheduler {
638638
*/
639639
cancel(): void {
640640
if (this.isScheduled()) {
641-
clearTimeout(this._timeoutToken);
642-
this._timeoutToken = -1;
641+
clearTimeout(this.timeoutToken);
642+
this.timeoutToken = -1;
643643
}
644644
}
645645

646646
/**
647647
* Cancel previous runner (if any) & schedule a new runner.
648648
*/
649-
schedule(delay = this._timeout): void {
649+
schedule(delay = this.timeout): void {
650650
this.cancel();
651-
this._timeoutToken = setTimeout(this._timeoutHandler, delay);
651+
this.timeoutToken = setTimeout(this.timeoutHandler, delay);
652652
}
653653

654-
get timeout(): number {
655-
return this._timeout;
654+
get delay(): number {
655+
return this.timeout;
656656
}
657657

658-
set timeout(value: number) {
659-
this._timeout = value;
658+
set delay(value: number) {
659+
this.timeout = value;
660660
}
661661

662662
/**
663663
* Returns true if scheduled.
664664
*/
665665
isScheduled(): boolean {
666-
return this._timeoutToken !== -1;
666+
return this.timeoutToken !== -1;
667667
}
668668

669669
private onTimeout() {
670-
this._timeoutToken = -1;
670+
this.timeoutToken = -1;
671671
if (this.runner) {
672672
this.doRun();
673673
}

src/vs/editor/contrib/codelens/codelensController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class CodeLensContribution implements IEditorContribution {
161161

162162
// update moving average
163163
const newDelay = this._getCodeLensModelDelays.update(model, Date.now() - t1);
164-
scheduler.timeout = newDelay;
164+
scheduler.delay = newDelay;
165165

166166
// render lenses
167167
this._renderCodeLensSymbols(result);
@@ -393,7 +393,7 @@ export class CodeLensContribution implements IEditorContribution {
393393

394394
// update moving average
395395
const newDelay = this._resolveCodeLensesDelays.update(model, Date.now() - t1);
396-
this._resolveCodeLensesScheduler.timeout = newDelay;
396+
this._resolveCodeLensesScheduler.delay = newDelay;
397397

398398
if (this._currentCodeLensModel) { // update the cached state with new resolved items
399399
this._codeLensCache.put(model, this._currentCodeLensModel);

0 commit comments

Comments
 (0)