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));