当前位置: 首页>>代码示例>>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;未经允许,请勿转载。