MCPcopy Index your code
hub / github.com/microsoft/vscode-js-debug / rebaseLocalToRemote

Function rebaseLocalToRemote

src/targets/sourcePathResolver.ts:173–187  ·  view source on GitHub ↗

* Rebases a local path to a remote one using the remote and local roots. * The path should should given as a filesystem path, not a URI.

(localPath: string)

Source from the content-addressed store, hash-verified

171 * The path should should given as a filesystem path, not a URI.
172 */
173 public rebaseLocalToRemote(localPath: string) {
174 if (!this.options.remoteRoot || !this.options.localRoot || !this.canMapPath(localPath)) {
175 return localPath;
176 }
177
178 const relPath = properRelative(this.options.localRoot, localPath);
179 let remotePath = properJoin(this.options.remoteRoot, relPath);
180
181 remotePath = fixDriveLetterAndSlashes(remotePath, /*uppercaseDriveLetter=*/ true);
182 this.logger.verbose(
183 LogTag.RuntimeSourceMap,
184 `Mapped localToRemote: ${localPath} -> ${remotePath}`,
185 );
186 return remotePath;
187 }
188
189 /**
190 * Normalizes a source map URL for further processing. Should be called

Callers

nothing calls this directly

Calls 4

properRelativeFunction · 0.90
properJoinFunction · 0.90
fixDriveLetterAndSlashesFunction · 0.90
verboseMethod · 0.65

Tested by

no test coverage detected