Fix markdown path suggestions on windows

This commit is contained in:
Matt Bierner
2022-01-13 16:38:45 -08:00
parent 8dbbccae21
commit 3d79cbb912
2 changed files with 8 additions and 5 deletions

View File

@@ -269,9 +269,13 @@ export class PathCompletionProvider implements vscode.CompletionItemProvider {
}
try {
return document.uri.with({
path: resolve(dirname(document.uri.path), ref),
});
if (document.uri.scheme === 'file') {
return vscode.Uri.file(resolve(dirname(document.uri.fsPath), ref));
} else {
return document.uri.with({
path: resolve(dirname(document.uri.path), ref),
});
}
} catch (e) {
return undefined;
}

View File

@@ -26,8 +26,7 @@ function getCompletionsAtCursor(resource: vscode.Uri, fileContents: string) {
});
}
suite.skip('Markdown path completion provider', () => {
suite('Markdown path completion provider', () => {
setup(async () => {
// These tests assume that the markdown completion provider is already registered