當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript RunOnceScheduler.schedule方法代碼示例

本文整理匯總了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);
		}
	}
開發者ID:developers23,項目名稱:vscode,代碼行數:9,代碼來源:progressbar.ts

示例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();
		}));
開發者ID:Elflyy,項目名稱:vscode,代碼行數:11,代碼來源:findModel.ts

示例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;
			}
		}
	}
開發者ID:,項目名稱:,代碼行數:21,代碼來源:

示例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();
	}
開發者ID:eklavyamirani,項目名稱:vscode,代碼行數:49,代碼來源:quickFixModel.ts

示例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;
		}
	}
開發者ID:,項目名稱:,代碼行數:16,代碼來源:

示例6:

		var scheduleColorize = () => colorize.schedule();
開發者ID:13572293130,項目名稱:vscode,代碼行數:1,代碼來源:colorizer.ts


注:本文中的vs/base/common/async.RunOnceScheduler.schedule方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。