Always add dirname of current md document to localResourceRoots

Fixes #139907

Previously we only added this dir on `file` file system
This commit is contained in:
Matt Bierner
2022-01-11 12:39:35 -08:00
parent 8b872a8571
commit 43c5bc4795

View File

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