Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onBreakpointChanged(breakpointId, verified) {
if (!this.registeredBreakpoints.has(breakpointId)) {
return;
}
const pythonBkpoint = this.registeredBreakpoints.get(breakpointId);
const breakpoint = new vscode_debugadapter_1.Breakpoint(verified, pythonBkpoint.LineNo, undefined, new vscode_debugadapter_1.Source(path.basename(pythonBkpoint.Filename), pythonBkpoint.Filename));
// VSC needs `id` to uniquely identify each breakpoint (part of the protocol spec).
breakpoint.id = pythonBkpoint.Id;
this.sendEvent(new vscode_debugadapter_1.BreakpointEvent('changed', breakpoint));
}
buildBreakpointDetails(filePath, line, condition) {
.then(javabp => {
if (!javabp.vsbp) {
// state is one of: set,notloaded,enabled,removed
var verified = !!javabp.state.match(/set|enabled/);
const bp = new Breakpoint(verified, this.convertDebuggerLineToClient(dbgline));
// the breakpoint *must* have an id field or it won't update properly
bp.id = ++this._breakpointId;
if (javabp.state === 'notloaded')
bp.message = 'The runtime hasn\'t loaded this code location';
javabp.vsbp = bp;
}
javabp.vsbp.order = idx;
javabp_arr.push(javabp);
}).
then((/*javabp*/) => _setup_breakpoints(o, ++idx, javabp_arr));
let breakpoint = null;
if (match) {
let filename = match[2];
// Ugly hack.
if (source && !this._filenameToPath.has(filename) && source.path && source.path.endsWith(filename)) {
this._filenameToPath.set(filename, source.path);
}
breakpoint = new Breakpoint(
true,
+match[3],
+match[4],
this.getSource(filename)
);
breakpoint[OCamlDebugSession.BREAKPOINT_ID] = +match[1];
} else {
breakpoint = new Breakpoint(false);
}
resolve(breakpoint);
});
});
private onBreakpointChanged(breakpointId: number, verified: boolean) {
if (!this.registeredBreakpoints.has(breakpointId)) {
return;
}
const pythonBkpoint = this.registeredBreakpoints.get(breakpointId)!;
const breakpoint = new Breakpoint(verified, pythonBkpoint.LineNo, undefined, new Source(path.basename(pythonBkpoint.Filename), pythonBkpoint.Filename));
// VSC needs `id` to uniquely identify each breakpoint (part of the protocol spec).
(breakpoint as any).id = pythonBkpoint.Id;
this.sendEvent(new BreakpointEvent('changed', breakpoint));
}
private buildBreakpointDetails(filePath: string, line: number, condition: string): IPythonBreakpoint {
.map(brk => new vscode_debugadapter_1.Breakpoint(true, this.convertDebuggerLineToClient(brk.line), undefined, new vscode_debugadapter_1.Source(brk.id + " - " + path_1.basename(scriptPath), this.convertDebuggerPathToClient(scriptPath))
//args.source.
))
};
breakpoints = args.lines.map(line => new vscode.Breakpoint(false, line));
breakpointsSetPromise = Promise.resolve();
.map(brk =>
new Breakpoint(
true,
this.convertDebuggerLineToClient(brk.line),
undefined,
new Source(
brk.id + " - " + basename(scriptPath),
this.convertDebuggerPathToClient(scriptPath)
)
//args.source.
))
};
public verifyBreakpoint(breakpointInfo: BreakpointInfo): void {
if (!breakpointInfo.actualLocation) return;
let breakpoint: DebugProtocol.Breakpoint = new Breakpoint(
true, breakpointInfo.actualLocation.line, breakpointInfo.actualLocation.column + 1);
breakpoint.id = breakpointInfo.id;
this.sendEvent(new BreakpointEvent('changed', breakpoint));
breakpointInfo.verified = true;
}
breakpoints = (args.breakpoints || []).map((sbp) => {
const breakpointString = `${sourcePath}:${sbp.line}`;
const bp: DebugProtocol.Breakpoint = new Breakpoint(
false,
sbp.line,
undefined,
new Source(breakpointString, args.source.path)
);
bp.id = this.getBreakPointId(breakpointString);
return bp;
});
breakpoints: brkpoints.map(brkp =>
new Breakpoint(brkp[0], brkp[0] ? brkp[1].line : undefined))
};