MCPcopy Index your code
hub / github.com/WebFreak001/code-debug / toLocalPath

Method toLocalPath

src/source_file_map.ts:76–90  ·  view source on GitHub ↗
(remotePath: string)

Source from the content-addressed store, hash-verified

74 }
75
76 public toLocalPath(remotePath: string): string {
77 // Try to detect remote path.
78 const debuggerPath: PathKind = this.toPathKind(remotePath);
79 const normalizedRemotePath: string = debuggerPath.normalize(remotePath);
80 const mapping: Mapping | undefined =
81 this.pathMatch("remote", debuggerPath.caseSensitive, normalizedRemotePath);
82
83 if (mapping) {
84 const pathSuffix = normalizedRemotePath.substring(mapping.remote.length);
85 return this.nativePath.join(mapping.local, pathSuffix);
86 }
87
88 // No mapping found, so return unmapped path.
89 return remotePath;
90 }
91
92 public toRemotePath (localPath: string): string {
93 const normalizedLocalPath = this.nativePath.normalize(localPath);

Callers 2

stackTraceRequestMethod · 0.80

Calls 2

toPathKindMethod · 0.95
pathMatchMethod · 0.95

Tested by

no test coverage detected