src/vs/editor/contrib/links/browser/getLinks.ts/getLinks
export function getLinks(providers: LanguageFeatureRegistry<LinkProvider>, model: ITextModel, token: CancellationToken): Promise<LinksList> {

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

	// ask all providers for links in parallel
	const promises = providers.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(() => {
		const result = new LinksList(coalesce(lists));
		if (!token.isCancellationRequested) {
			return result;
		}
		result.dispose();
		return new LinksList([]);
	});
}