Fix md document links for untitled files (#155248)

This commit is contained in:
Matt Bierner 2022-07-14 18:15:13 -07:00 committed by GitHub
parent 171537fd73
commit 394eaa9fa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -162,7 +162,10 @@ export class VsCodeClientWorkspace implements md.IWorkspace {
}
}
stat(resource: URI): Promise<md.FileStat | undefined> {
async stat(resource: URI): Promise<md.FileStat | undefined> {
if (this._documentCache.has(resource) || this.documents.get(resource.toString())) {
return { isDirectory: false };
}
return this.connection.sendRequest(protocol.statFileRequestType, { uri: resource.toString() });
}

View file

@ -134,7 +134,7 @@ async function getLinksForFile(file: vscode.Uri): Promise<vscode.DocumentLink[]>
}
});
test.skip('Should navigate to fragment within current untitled file', async () => { // TODO: skip for now for ls migration
test('Should navigate to fragment within current untitled file', async () => { // TODO: skip for now for ls migration
const testFile = workspaceFile('x.md').with({ scheme: 'untitled' });
await withFileContents(testFile, joinLines(
'[](#second)',