(uri: URI)
| 70 | * This string is ONLY for comparising URIs to see if they are "the same document". |
| 71 | */ |
| 72 | export function uriComparisonString(uri: URI): string { |
| 73 | if (uri.scheme === "file" || uri.scheme.endsWith("+file")) { |
| 74 | const uriString = `${uri.scheme}:${fsPath(uri.with({ scheme: "file" }))}`; |
| 75 | // VS Code treats Windows as case-insensitive and not others (regardless |
| 76 | // of the actual file system settings). |
| 77 | return isWin ? uriString.toLowerCase() : uriString; |
| 78 | } else { |
| 79 | return uri.toString(); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | /// Shortens a path to use ~ if it's inside the home directory and always |
| 84 | // uses forward slashes in that case. |
no test coverage detected