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


TypeScript async.asWinJsPromise函數代碼示例

本文整理匯總了TypeScript中vs/base/common/async.asWinJsPromise函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript asWinJsPromise函數的具體用法?TypeScript asWinJsPromise怎麽用?TypeScript asWinJsPromise使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了asWinJsPromise函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: asWinJsPromise

	const promises = LinkProviderRegistry.ordered(model).reverse().map(support => {
		return asWinJsPromise(token => support.provideLinks(model, token)).then(result => {
			if (Array.isArray(result)) {
				links = union(links, result);
			}
		}, onUnexpectedError);
	});
開發者ID:1Hgm,項目名稱:vscode,代碼行數:7,代碼來源:links.ts

示例2: asWinJsPromise

			return TPromise.join(supports.map(support => asWinJsPromise(token => support.provideCompletionItems(model, position, token)).then(values => {
				if (!isFalsyOrEmpty(values)) {
					for (let suggestResult of values) {
						hasResult = fillInSuggestResult(result, suggestResult, support, suggestFilter) || hasResult;
					}
				}
			}, onUnexpectedError)));
開發者ID:ChristianAlexander,項目名稱:vscode,代碼行數:7,代碼來源:suggest.ts

示例3: asWinJsPromise

	const promises = ColorProviderRegistry.ordered(model).reverse().map(provider => {
		return asWinJsPromise(token => provider.provideColorRanges(model, token)).then(result => {
			if (Array.isArray(result)) {
				colorInfo = colorInfo.concat(result);
			}
		}, onUnexpectedExternalError);
	});
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:7,代碼來源:colorPicker.ts

示例4: asWinJsPromise

	const promises = provider.map(provider => asWinJsPromise(token => provider.provideCodeLenses(model, token)).then(result => {
		if (Array.isArray(result)) {
			for (let symbol of result) {
				symbols.push({ symbol, provider });
			}
		}
	}, onUnexpectedExternalError));
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:7,代碼來源:codelens.ts

示例5: asWinJsPromise

			return TPromise.join(supports.map(support => asWinJsPromise(token => support.provideCompletionItems(model, position, token)).then(container => {

				const len = result.length;

				if (container && !isFalsyOrEmpty(container.suggestions)) {
					for (let suggestion of container.suggestions) {
						if (acceptSuggestion(suggestion)) {

							fixOverwriteBeforeAfter(suggestion, container);

							result.push({
								container,
								suggestion,
								support,
								resolve: createSuggestionResolver(support, suggestion, model, position)
							});
						}
					}
				}

				if (len !== result.length && support !== snippetSuggestSupport) {
					hasResult = true;
				}

			}, onUnexpectedError)));
開發者ID:BlackstarSoon,項目名稱:vscode,代碼行數:25,代碼來源:suggest.ts

示例6: asWinJsPromise

	const promises = providers.map(provider => asWinJsPromise(token => provider.provideDocumentColors(model, token)).then(result => {
		if (Array.isArray(result)) {
			for (let ci of result) {
				rawCIs.push({ range: ci.range, color: [ci.color.red, ci.color.green, ci.color.blue, ci.color.alpha] });
			}
		}
	}));
開發者ID:developers23,項目名稱:vscode,代碼行數:7,代碼來源:color.ts

示例7: return

	return () => {
		if (typeof provider.resolveCompletionItem === 'function') {
			return asWinJsPromise(token => provider.resolveCompletionItem(model, position, suggestion, token))
				.then(value => { assign(suggestion, value); });
		}
		return TPromise.as(void 0);
	};
開發者ID:SeanKilleen,項目名稱:vscode,代碼行數:7,代碼來源:suggest.ts

示例8: asWinJsPromise

			return TPromise.join(supports.map(support => {

				if (!isFalsyOrEmpty(onlyFrom) && onlyFrom.indexOf(support) < 0) {
					return undefined;
				}

				return asWinJsPromise(token => support.provideCompletionItems(model, position, suggestConext, token)).then(container => {

					const len = allSuggestions.length;

					if (container && !isFalsyOrEmpty(container.suggestions)) {
						for (let suggestion of container.suggestions) {
							if (acceptSuggestion(suggestion)) {

								fixOverwriteBeforeAfter(suggestion, container);

								allSuggestions.push({
									position,
									container,
									suggestion,
									support,
									resolve: createSuggestionResolver(support, suggestion, model, position)
								});
							}
						}
					}

					if (len !== allSuggestions.length && support !== _snippetSuggestSupport) {
						hasResult = true;
					}

				}, onUnexpectedExternalError);
			}));
開發者ID:SeanKilleen,項目名稱:vscode,代碼行數:33,代碼來源:suggest.ts

示例9: asWinJsPromise

			return TPromise.join(supports.map(support => {
				return asWinJsPromise((token) => {
					return support.provideCompletionItems(model, position, token);
				}).then(values => {

					if (!values) {
						return;
					}

					for (let suggestResult of values) {

						if (!suggestResult || isFalsyOrEmpty(suggestResult.suggestions)) {
							continue;
						}

						result.push({
							support,
							currentWord: suggestResult.currentWord,
							incomplete: suggestResult.incomplete,
							suggestions: suggestResult.suggestions
						});
					}

				}, onUnexpectedError);
			}));
開發者ID:Buildsoftwaresphere,項目名稱:vscode,代碼行數:25,代碼來源:suggest.ts

示例10: return

			return () => {
				return asWinJsPromise(token => provider.provideDocumentFormattingEdits(model, options, token)).then(value => {
					result = value;
				}, err => {
					// ignore
				});
			};
開發者ID:elemongw,項目名稱:vscode,代碼行數:7,代碼來源:format.ts


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