418
419
async realpath(resource: URI): Promise<string> {
421
>
// Synthetic roots and virtual content schemes have no distinct
422
>
// canonical path — return the input path unchanged.
423
>
if (path === '/' || path === '') {
424
return path;
425
}
427
>
if (decoded.scheme === 'session-db' || decoded.scheme === 'git-blob' || decoded.path === '/' || decoded.path === '') {
428
return path;
429
}
431
>
try {
432
>
const resolved = await this._resolve(connection, decoded);
433
>
// `resolved.uri` is the remote canonical (realpath) URI. Re-encode
434
>
// it back into provider space; the file service applies the
435
>
// returned path onto the original provider URI.
436
>
return this._encodeUri(URI.parse(resolved.uri), resource.authority).path;
437
>
} catch (err) {
438
throw this._mapError(err, FileSystemProviderErrorCode.FileNotFound);
439
}
441
442
async readdir(resource: URI): Promise<[string, FileType][]> {