MCPcopy
hub / github.com/microsoft/vscode-js-debug / fixDriveLetterAndSlashes

Function fixDriveLetterAndSlashes

src/common/pathUtils.ts:195–210  ·  view source on GitHub ↗
(
  aPath: string | undefined,
  uppercaseDriveLetter = false,
)

Source from the content-addressed store, hash-verified

193 uppercaseDriveLetter?: boolean,
194): string | undefined;
195export function fixDriveLetterAndSlashes(
196 aPath: string | undefined,
197 uppercaseDriveLetter = false,
198): string | undefined {
199 if (!aPath) return aPath;
200
201 aPath = fixDriveLetter(aPath, uppercaseDriveLetter);
202 if (isWindowsFileUri(aPath)) {
203 const prefixLen = fileUriPrefix.length;
204 aPath = aPath.substr(0, prefixLen + 1) + aPath.substr(prefixLen + 1).replace(/\//g, '\\');
205 } else if (isWindowsPath(aPath)) {
206 aPath = aPath.replace(/\//g, '\\');
207 }
208
209 return aPath;
210}
211
212/**
213 * Replace any backslashes with forward slashes

Callers 14

gatherSmFunction · 0.90
gatherSmNamesFunction · 0.90
pathUtils.test.tsFile · 0.90
rebaseLocalToRemoteFunction · 0.90
tryGetCompiledFileMethod · 0.90
fileUrlToAbsolutePathFunction · 0.90
getComputedSourceRootFunction · 0.90
computedSourceUrlMethod · 0.90
streamAllChildrenMethod · 0.90
setBreakpointsMethod · 0.90

Calls 4

isWindowsFileUriFunction · 0.85
isWindowsPathFunction · 0.85
fixDriveLetterFunction · 0.70
replaceMethod · 0.65

Tested by 2

gatherSmFunction · 0.72
gatherSmNamesFunction · 0.72