Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Better fix for microsoft/vscode#69118
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Mar 9, 2019
1 parent f8d962c commit 296f155
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/chrome/chromeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
stackFrames,
totalFrames
};
this._pathTransformer.stackTraceResponse(stackTraceResponse);
await this._pathTransformer.stackTraceResponse(stackTraceResponse);
await this._sourceMapTransformer.stackTraceResponse(stackTraceResponse);

await Promise.all(stackTraceResponse.stackFrames.map(async (frame, i) => {
Expand Down
7 changes: 5 additions & 2 deletions src/transformers/remotePathTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ export class RemotePathTransformer extends UrlPathTransformer {
}

public async scriptParsed(scriptPath: string): Promise<string> {
scriptPath = await super.scriptParsed(scriptPath);
if (!this.shouldMapPaths(scriptPath)) {
scriptPath = await super.scriptParsed(scriptPath);
}

scriptPath = this.getClientPathFromTargetPath(scriptPath) || scriptPath;

return scriptPath;
Expand All @@ -89,7 +92,7 @@ export class RemotePathTransformer extends UrlPathTransformer {

private shouldMapPaths(remotePath: string): boolean {
// Map paths only if localRoot/remoteRoot are set, and the remote path is absolute on some system
return !!this._localRoot && !!this._remoteRoot && (path.posix.isAbsolute(remotePath) || path.win32.isAbsolute(remotePath));
return !!this._localRoot && !!this._remoteRoot && (path.posix.isAbsolute(remotePath) || path.win32.isAbsolute(remotePath) || utils.isFileUrl(remotePath));
}

public getClientPathFromTargetPath(remotePath: string): string {
Expand Down

0 comments on commit 296f155

Please sign in to comment.