本文整理匯總了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);
});
示例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)));
示例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);
});
示例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));
示例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)));
示例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] });
}
}
}));
示例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);
};
示例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);
}));
示例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);
}));
示例10: return
return () => {
return asWinJsPromise(token => provider.provideDocumentFormattingEdits(model, options, token)).then(value => {
result = value;
}, err => {
// ignore
});
};