283
284
hasTrailingPathSeparator(resource: URI, sep: string = paths.sep): boolean {
286
>
const fsp = originalFSPath(resource);
287
>
return fsp.length > extpath.getRoot(fsp).length && fsp[fsp.length - 1] === sep;
288
>
} else {
289
const p = resource.path;
290
return (p.length > 1 && p.charCodeAt(p.length - 1) === CharCode.Slash) && !(/^[a-zA-Z]:(\/$|\\$)/.test(resource.fsPath)); // ignore the slash at offset 0
291
}
293
294
removeTrailingPathSeparator(resource: URI, sep: string = paths.sep): URI {
295
>
// Make sure that the path isn't a drive letter. A trailing separator there is not removable.
resources.ts
296
>
if (hasTrailingPathSeparator(resource, sep)) {
297
return resource.with({ path: resource.path.substr(0, resource.path.length - 1) });
298
}
300
>
}
301
302
addTrailingPathSeparator(resource: URI, sep: string = paths.sep): URI {