From 43c5bc4795d41adcd27f9846e6311eb841100656 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 11 Jan 2022 12:39:35 -0800 Subject: [PATCH] Always add dirname of current md document to localResourceRoots Fixes #139907 Previously we only added this dir on `file` file system --- .../markdown-language-features/src/features/preview.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/markdown-language-features/src/features/preview.ts b/extensions/markdown-language-features/src/features/preview.ts index 408c0d47b3b..3bca69f231f 100644 --- a/extensions/markdown-language-features/src/features/preview.ts +++ b/extensions/markdown-language-features/src/features/preview.ts @@ -463,14 +463,13 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider { if (workspaceRoots) { baseRoots.push(...workspaceRoots); } - } else if (!this._resource.scheme || this._resource.scheme === 'file') { - baseRoots.push(vscode.Uri.file(path.dirname(this._resource.fsPath))); + } else { + baseRoots.push(this._resource.with({ path: path.dirname(this._resource.path) })); } return baseRoots; } - private async onDidClickPreviewLink(href: string) { const targetResource = resolveDocumentLink(href, this.resource);