MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / uriComparisonString

Function uriComparisonString

src/shared/utils/fs.ts:72–81  ·  view source on GitHub ↗
(uri: URI)

Source from the content-addressed store, hash-verified

70 * This string is ONLY for comparising URIs to see if they are "the same document".
71 */
72export 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.

Callers 5

fs.test.tsFile · 0.90
keyMethod · 0.90
findVisibleEditorFunction · 0.90
isRealEditorMethod · 0.90
goToLocationMethod · 0.90

Calls 2

fsPathFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected