(file: Uri | undefined, cwd: Uri | undefined, homePath: Uri | undefined)
| 86 | } |
| 87 | |
| 88 | function getDisplayPathImpl(file: Uri | undefined, cwd: Uri | undefined, homePath: Uri | undefined): string { |
| 89 | const isWindows = getOSType() === OSType.Windows; |
| 90 | if (file && cwd && uriPath.isEqualOrParent(file, cwd, true)) { |
| 91 | const relativePath = uriPath.relativePath(cwd, file); |
| 92 | if (relativePath) { |
| 93 | // On windows relative path will still use forwardslash because uriPath.relativePath is a URI path |
| 94 | return isWindows ? relativePath.replace(/\//g, '\\') : relativePath; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | if (file && homePath && uriPath.isEqualOrParent(file, homePath, true)) { |
| 99 | let relativePath = uriPath.relativePath(homePath, file); |
| 100 | if (relativePath) { |
| 101 | // On windows relative path will still use forwardslash because uriPath.relativePath is a URI path |
| 102 | relativePath = isWindows ? relativePath.replace(/\//g, '\\') : relativePath; |
| 103 | return `~${path.sep}${relativePath}`; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | return getFilePath(file); |
| 108 | } |
no test coverage detected