-
Notifications
You must be signed in to change notification settings - Fork 819
-
Hi all.
We have been using the VSCode Go extension (congrats for the integration) for several years now and for a couple of months, an issue impacts our debugging workflow.
We did not find any related issue on the subject and we are looking for advices here.
We use the following debugging pattern:
- start a debug session defined in
launch.json
- use the mighty "debug test" to debug a specific test function which requires the previously started debug session
Whereas it used to work (not sure exactly when it stops working), we now get the following error message ‘Debug session has already been started’.
As a (painful) workaround, we use the following pattern:
- add a breakpoint on the first line of the test function
- click on "debug test"
- when the breakpoint is reached, start the debug session from launch.json
- continue debugging
Since this works, since the "compounds" section of launch.json
also works, there seems to be no limitation in debugging several processes at the same time.
After a quick search, the culprit code seems to be located in
Line 358 in 83aa2cb
vscode.commands.registerCommand('go.debug.cursor', (args) => { if (vscode.debug.activeDebugSession) { vscode.window.showErrorMessage('Debug session has already been started'); return; } const goConfig = getGoConfig(); testAtCursor(goConfig, 'debug', args); })
The final question is: why is the vscode.debug.activeDebugSession flag taken into account when locally debugging a specific test?
A local build of the extension without the test on
vscode.debug.activeDebugSession
seems to be fine.
Should there be a better place to ask, please redirect me to it!
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 2 replies
-
That check was added as a workaround for #109 (microsoft/vscode-go#1383). Ability to use multiple debugging sessions is cool. I think more correct way to handle the original issue is to address only this specific case (debug session started with the test codelens).
Beta Was this translation helpful? Give feedback.
All reactions
-
Filed #1710
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks for the analyse and issue @hyangah
Beta Was this translation helpful? Give feedback.