Skip to content

Commit 6f7fa56

Browse files
Remove extra checks in hasActiveSession() that causes hang after start_debugging if not stopped at a breakpoint
1 parent 825ed44 commit 6f7fa56

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

src/debuggingExecutor.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -337,24 +337,7 @@ export class DebuggingExecutor implements IDebuggingExecutor {
337337
* Check if there's an active debug session that is ready for debugging operations
338338
*/
339339
public async hasActiveSession(): Promise<boolean> {
340-
// Quick check first - no session at all
341-
if (!vscode.debug.activeDebugSession) {
342-
return false;
343-
}
344-
345-
try {
346-
// Get the current debug state and check if it has location information
347-
// This is the most reliable way to determine if the debugger is truly ready
348-
const debugState = await this.getCurrentDebugState();
349-
350-
// A session is ready when it has location info (file name and line number)
351-
// This means the debugger has attached and we can see where we are in the code
352-
return debugState.sessionActive && debugState.hasLocationInfo();
353-
} catch (error) {
354-
// Any error means session isn't ready (e.g., Python still initializing)
355-
console.log('Session readiness check failed:', error);
356-
return false;
357-
}
340+
return vscode.debug.activeDebugSession !== undefined;
358341
}
359342

360343
/**

0 commit comments

Comments
 (0)