extensions/markdown-language-features/src/util/openDocumentLink.ts/tryResolveUriToMarkdownFile
async function tryResolveUriToMarkdownFile(resource: vscode.Uri): Promise<vscode.TextDocument | undefined> {
	let document: vscode.TextDocument;
	try {
		document = await vscode.workspace.openTextDocument(resource);
	} catch {
		return undefined;
	}
	if (isMarkdownFile(document)) {
		return document;
	}
	return undefined;
}