本文整理匯總了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();