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 debug session to be deleted in $sessionDidDestroy instead of $terminateDebugSession #10954

Merged

Conversation

Bolodya1997
Copy link
Contributor

What it does

Related to #10953.

Cause

$terminateDebugSession always comes before $sessionDidDestroy and removes debug session from sessions.
As a result, $sessionDidDestroy never fires onDidTerminateDebugSessionEmitter, because there is no session at the moment of the execution.

Solution

$terminateDebugSession shouldn't delete debug session, it should only terminate (stop) it - it comes from the method name.
$sessionDidDestroy should delete debug session - it also comes from the method name.

How to test

  1. Create test plugin:
import * as vscode from "vscode";
import { ExtensionContext, window } from "vscode";

export async function activate(_: ExtensionContext) {
  vscode.debug.onDidStartDebugSession((session: vscode.DebugSession) => {
    window.showInformationMessage(`Started debug session: ${session.id}`);
  });

  vscode.debug.onDidTerminateDebugSession((session: vscode.DebugSession) => {
    window.showInformationMessage(`Terminated debug session: ${session.id}`);
  });
}
  1. Run Theia with any language supported (tested with Python) with test plugin added.
  2. Create any debug configuration.
    image
  3. Run debug session.
    image

Expected behavior

  1. Information message 'Started debug session' is shown on execution start.
  2. Information message 'Terminated debug session' is shown on execution end.

Review checklist

Reminder for reviewers

…minateDebugSession

Signed-off-by: Vladimir Popov <Vladimir.Popov@spirent.com>
@msujew msujew linked an issue Mar 30, 2022 that may be closed by this pull request
@vince-fugnitto vince-fugnitto added vscode issues related to VSCode compatibility debug issues that related to debug functionality labels Mar 31, 2022
@Bolodya1997
Copy link
Contributor Author

@vince-fugnitto @msujew
Please add some comments on this :)
Probably there is someone else who I can mention to get this PR reviewed?

@msujew msujew self-requested a review April 4, 2022 10:14
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your first contribution @Bolodya1997!

I can confirm that the issue exists on master and is fixed by these changes 👍

@msujew msujew merged commit 4c6f4e0 into eclipse-theia:master Apr 11, 2022
@vince-fugnitto vince-fugnitto added this to the 1.25.0 milestone Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug issues that related to debug functionality vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vscode.debug.onDidTerminateDebugSession never calls listener
3 participants