Skip to content

Commit 77f4d10

Browse files
erikson84Erikson Kaszubowski
andauthored
fix: ensure backslash in path when setting breakpoints in windows (#2184)
Co-authored-by: Erikson Kaszubowski <[email protected]>
1 parent 7cd78eb commit 77f4d10

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/adapter/breakpoints.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { inject, injectable } from 'inversify';
66
import Cdp from '../cdp/api';
77
import { ILogger, LogTag } from '../common/logging';
88
import { bisectArrayAsync, flatten } from '../common/objUtils';
9+
import { fixDriveLetterAndSlashes } from '../common/pathUtils';
910
import { IPosition } from '../common/positions';
1011
import { delay } from '../common/promiseUtil';
1112
import { SourceMap } from '../common/sourceMaps/sourceMap';
@@ -526,7 +527,7 @@ export class BreakpointManager {
526527
}
527528

528529
const wasEntryBpSet = await this._sourceMapHandlerInstalled?.entryBpSet;
529-
params.source.path = urlUtils.platformPathToPreferredCase(params.source.path);
530+
params.source.path = fixDriveLetterAndSlashes(params.source.path, true);
530531
const containedSource = this._sourceContainer.source(params.source);
531532

532533
// Wait until the breakpoint predictor finishes to be sure that we

src/common/pathUtils.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,18 @@ export function fixDriveLetter(aPath: string, uppercaseDriveLetter = false): str
184184
/**
185185
* Ensure lower case drive letter and \ on Windows
186186
*/
187-
export function fixDriveLetterAndSlashes(aPath: string, uppercaseDriveLetter = false): string {
187+
export function fixDriveLetterAndSlashes(
188+
aPath: string,
189+
uppercaseDriveLetter?: boolean,
190+
): string;
191+
export function fixDriveLetterAndSlashes(
192+
aPath: string | undefined,
193+
uppercaseDriveLetter?: boolean,
194+
): string | undefined;
195+
export function fixDriveLetterAndSlashes(
196+
aPath: string | undefined,
197+
uppercaseDriveLetter = false,
198+
): string | undefined {
188199
if (!aPath) return aPath;
189200

190201
aPath = fixDriveLetter(aPath, uppercaseDriveLetter);

0 commit comments

Comments
 (0)