Use joinPath in a few more places

This commit is contained in:
Matt Bierner 2020-06-09 16:35:02 -07:00
parent 2ef9b54911
commit 1275b918be
2 changed files with 2 additions and 2 deletions

View file

@ -132,7 +132,7 @@ export class MarkdownContentProvider {
// Use a workspace relative path if there is a workspace
const root = vscode.workspace.getWorkspaceFolder(resource);
if (root) {
return resourceProvider.asWebviewUri(vscode.Uri.file(path.join(root.uri.fsPath, href))).toString();
return resourceProvider.asWebviewUri(vscode.Uri.joinPath(root.uri, href)).toString();
}
// Otherwise look relative to the markdown file

View file

@ -240,7 +240,7 @@ export class MarkdownEngine {
if (uri.path[0] === '/') {
const root = vscode.workspace.getWorkspaceFolder(this.currentDocument!);
if (root) {
const fileUri = vscode.Uri.file(path.join(root.uri.fsPath, uri.fsPath));
const fileUri = vscode.Uri.joinPath(root.uri, uri.fsPath);
uri = fileUri.with({
scheme: uri.scheme,
fragment: uri.fragment,