Skip to content

Commit cfd5b16

Browse files
committed
[DebugAdapter] Goto first bp if one is set on start up
1 parent e37a549 commit cfd5b16

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎editors/code/src/debugAdapter.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export class DebugSession extends LoggingDebugSession {
189189
};
190190

191191
if (breakpoints.length > 0) {
192+
this._logDebugger.gotoBreakpoint();
192193
this.sendEvent(new StoppedEvent('breakpoint', DebugSession._threadID));
193194
}
194195
return this.sendResponse(response);

‎editors/code/src/test/unit/debugAdapter.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,15 @@ suite('DebugAdapter Test Suite', () => {
174174
});
175175

176176
suite('Breakpoint Tests', () => {
177+
const logPath = "path-to-log";
177178
setup(() => {
178179
debugSession = createSession(logDebugger);
180+
logDebugger.setToLog(logPath, 5);
179181
});
180182

181183
test('Should set breakpoints correctly', () => {
182-
const sourcePath = '/test/source/file.log';
183184
const args: DebugProtocol.SetBreakpointsArguments = {
184-
source: { path: sourcePath },
185+
source: { path: logPath },
185186
breakpoints: [{ line: 10 }, { line: 20 }, { line: 30 }]
186187
};
187188
const response: DebugProtocol.SetBreakpointsResponse = {
@@ -202,6 +203,7 @@ suite('DebugAdapter Test Suite', () => {
202203
assert.strictEqual(bp.line, args.breakpoints![index].line, `Breakpoint ${index} should have correct line`);
203204
});
204205
assert.strictEqual(eventCount, 1, 'Should send stopped event');
206+
assert.strictEqual(logDebugger.linenum(), 10, 'Should set logDebugger to first breakpoint');
205207
});
206208

207209
test('Should handle empty breakpoints array', () => {

0 commit comments

Comments
 (0)