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


TypeScript modes.LinkProviderRegistry類代碼示例

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


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

示例1: getLinks

export function getLinks(model: ITextModel, token: CancellationToken): Promise<LinksList> {

	const lists: [ILinksList, LinkProvider][] = [];

	// ask all providers for links in parallel
	const promises = LinkProviderRegistry.ordered(model).reverse().map((provider, i) => {
		return Promise.resolve(provider.provideLinks(model, token)).then(result => {
			if (result) {
				lists[i] = [result, provider];
			}
		}, onUnexpectedExternalError);
	});

	return Promise.all(promises).then(() => new LinksList(coalesce(lists)));
}
開發者ID:eamodio,項目名稱:vscode,代碼行數:15,代碼來源:getLinks.ts

示例2: getLinks

export function getLinks(model: IReadOnlyModel): TPromise<ILink[]> {

	let links: ILink[] = [];

	// ask all providers for links in parallel
	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);
	});

	return TPromise.join(promises).then(() => {
		return links;
	});
}
開發者ID:1Hgm,項目名稱:vscode,代碼行數:17,代碼來源:links.ts

示例3: getLinks

export function getLinks(model: ITextModel, token: CancellationToken): Promise<Link[]> {

	let links: Link[] = [];

	// ask all providers for links in parallel
	const promises = LinkProviderRegistry.ordered(model).reverse().map(provider => {
		return Promise.resolve(provider.provideLinks(model, token)).then(result => {
			if (Array.isArray(result)) {
				const newLinks = result.map(link => new Link(link, provider));
				links = union(links, newLinks);
			}
		}, onUnexpectedExternalError);
	});

	return Promise.all(promises).then(() => {
		return links;
	});
}
開發者ID:joelday,項目名稱:vscode,代碼行數:18,代碼來源:getLinks.ts

示例4: getLinks

export function getLinks(model: IReadOnlyModel): TPromise<Link[]> {

	let links: Link[] = [];

	// ask all providers for links in parallel
	const promises = LinkProviderRegistry.ordered(model).reverse().map(provider => {
		return asWinJsPromise(token => provider.provideLinks(model, token)).then(result => {
			if (Array.isArray(result)) {
				const newLinks = result.map(link => new Link(link, provider));
				links = union(links, newLinks);
			}
		}, onUnexpectedExternalError);
	});

	return TPromise.join(promises).then(() => {
		return links;
	});
}
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:18,代碼來源:links.ts

示例5: registerLinkProvider

export function registerLinkProvider(languageId: string, provider: modes.LinkProvider): IDisposable {
	return modes.LinkProviderRegistry.register(languageId, provider);
}
開發者ID:ramesius,項目名稱:vscode,代碼行數:3,代碼來源:standaloneLanguages.ts


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