本文整理汇总了TypeScript中vs/base/common/async.RunOnceScheduler.schedule方法的典型用法代码示例。如果您正苦于以下问题:TypeScript RunOnceScheduler.schedule方法的具体用法?TypeScript RunOnceScheduler.schedule怎么用?TypeScript RunOnceScheduler.schedule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/base/common/async.RunOnceScheduler
的用法示例。
在下文中一共展示了RunOnceScheduler.schedule方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: show
show(delay?: number): void {
this.showDelayedScheduler.cancel();
if (typeof delay === 'number') {
this.showDelayedScheduler.schedule(delay);
} else {
show(this.element);
}
}
示例2:
this._toDispose.push(this._editor.addListener2(editorCommon.EventType.ModelContentChanged, (e:editorCommon.IModelContentChangedEvent) => {
if (this._ignoreModelContentChanged) {
return;
}
if (e.changeType === editorCommon.EventType.ModelContentChangedFlush) {
// a model.setValue() was called
this._decorations.reset();
}
this._decorations.setStartPosition(this._editor.getPosition());
this._updateDecorationsScheduler.schedule();
}));
示例3: start
public start(mode: HoverStartMode): void {
if (mode === HoverStartMode.Delayed) {
if (this._state === ComputeHoverOperationState.IDLE) {
this._state = ComputeHoverOperationState.FIRST_WAIT;
this._firstWaitScheduler.schedule(this._firstWaitTime());
this._loadingMessageScheduler.schedule(this._loadingMessageTime());
}
} else {
switch (this._state) {
case ComputeHoverOperationState.IDLE:
this._triggerAsyncComputation();
this._secondWaitScheduler.cancel();
this._triggerSyncComputation();
break;
case ComputeHoverOperationState.SECOND_WAIT:
this._secondWaitScheduler.cancel();
this._triggerSyncComputation();
break;
}
}
}
示例4: onCursorPositionChanged
private onCursorPositionChanged(): void {
if (this.triggerAutoSuggestPromise) {
this.triggerAutoSuggestPromise.cancel();
this.triggerAutoSuggestPromise = null;
}
this.cancelDialog();
if (!this.updateScheduler) {
this.updateScheduler = new RunOnceScheduler(() => {
const pos = this.editor.getPosition();
let marker = this.lastMarker;
if (marker && Range.containsPosition(marker, pos)) {
// still on the same marker
if (this.lightBulpPosition) {
this.setDecoration(pos);
}
return;
}
if (!this.editor.isFocused()) {
// remove lightbulb when editor lost focus
this.setDecoration(null);
return;
}
this.lastMarker = marker = this.findMarker(pos, false);
if (!marker) {
// remove lightbulp
this.setDecoration(null);
return;
}
const $tRequest = timer.start(timer.Topic.EDITOR, 'quickfix/lighbulp');
const computeFixesPromise = this.computeFixes(marker);
computeFixesPromise.done((fixes) => {
this.setDecoration(!arrays.isFalsyOrEmpty(fixes) ? pos : null);
this.triggerAutoSuggest(marker);
$tRequest.stop();
}, (error) => {
onUnexpectedError(error);
this.setDecoration(null);
$tRequest.stop();
});
}, 250);
this.toLocalDispose.push(this.updateScheduler);
}
this.updateScheduler.schedule();
}
示例5: _triggerAsyncComputation
private _triggerAsyncComputation(): void {
this._state = ComputeHoverOperationState.SECOND_WAIT;
this._secondWaitScheduler.schedule(this._secondWaitTime());
if (this._computer.computeAsync) {
this._asyncComputationPromiseDone = false;
this._asyncComputationPromise = createCancelablePromise(token => this._computer.computeAsync!(token));
this._asyncComputationPromise.then((asyncResult: Result) => {
this._asyncComputationPromiseDone = true;
this._withAsyncResult(asyncResult);
}, (e) => this._onError(e));
} else {
this._asyncComputationPromiseDone = true;
}
}
示例6:
var scheduleColorize = () => colorize.schedule();