Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: invalid bps not always removed on overlaid file #1813

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions src/adapter/breakpoints/breakpointBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IPosition } from '../../common/positions';
import { absolutePathToFileUrl } from '../../common/urlUtils';
import Dap from '../../dap/api';
import { BreakpointManager } from '../breakpoints';
import { ISourceScript, IUiLocation, Source, SourceFromMap, base1To0 } from '../source';
import { ISourceScript, IUiLocation, SourceFromMap, base1To0 } from '../source';
import { Script, Thread } from '../threads';

export type LineColumn = { lineNumber: number; columnNumber: number }; // 1-based
Expand Down Expand Up @@ -325,7 +325,7 @@ export abstract class Breakpoint {
continue;
}

if (!this.breakpointIsForSource(bp.args, source)) {
if (!breakpointIsForUrl(bp.args, script.url)) {
continue;
}

Expand Down Expand Up @@ -381,26 +381,6 @@ export abstract class Breakpoint {
);
}

/**
* Gets whether the breakpoint was set in the source by URL. Also checks
* the rebased remote paths, since Sources are always normalized to the
* 'local' locations, but the CDP set is for the remote.
*/
private breakpointIsForSource(args: Cdp.Debugger.SetBreakpointByUrlParams, source: Source) {
if (breakpointIsForUrl(args, source.url)) {
return true;
}

const remotePath = this._manager._sourceContainer.sourcePathResolver.rebaseLocalToRemote(
source.absolutePath,
);
if (breakpointIsForUrl(args, remotePath)) {
return true;
}

return false;
}

/**
* Gets the condition under which this breakpoint should be hit.
*/
Expand Down
Loading