301
302
addTrailingPathSeparator(resource: URI, sep: string = paths.sep): URI {
304
>
if (resource.scheme === Schemas.file) {
305
>
const fsp = originalFSPath(resource);
306
>
isRootSep = ((fsp !== undefined) && (fsp.length === extpath.getRoot(fsp).length) && (fsp[fsp.length - 1] === sep));
307
>
} else {
308
>
sep = '/';
309
>
const p = resource.path;
310
>
isRootSep = p.length === 1 && p.charCodeAt(p.length - 1) === CharCode.Slash;
311
>
}
312
>
if (!isRootSep && !hasTrailingPathSeparator(resource, sep)) {
313
>
return resource.with({ path: resource.path + '/' });
314
>
}
315
>
return resource;
316
>
}
317
}
318