From e7bc301be6fcb35f9fdc5d46665c48210756bd7d Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 13 Apr 2020 13:02:14 -0700 Subject: [PATCH] When clicking on a link to a folder in markdown, reveal the folder Fixes #91336 --- .../src/commands/openDocumentLink.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/markdown-language-features/src/commands/openDocumentLink.ts b/extensions/markdown-language-features/src/commands/openDocumentLink.ts index ef173b60854..6194dbe7226 100644 --- a/extensions/markdown-language-features/src/commands/openDocumentLink.ts +++ b/extensions/markdown-language-features/src/commands/openDocumentLink.ts @@ -66,6 +66,11 @@ export class OpenDocumentLinkCommand implements Command { } } + const stat = await vscode.workspace.fs.stat(resource); + if (stat.type === vscode.FileType.Directory) { + return vscode.commands.executeCommand('revealInExplorer', resource); + } + return vscode.workspace.openTextDocument(resource) .then(document => vscode.window.showTextDocument(document, column)) .then(editor => this.tryRevealLine(editor, args.fragment)); -- GitLab