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

debug: add support for stopDebugging api #10638

Merged
merged 1 commit into from
Jan 18, 2022
Merged

Conversation

vince-fugnitto
Copy link
Member

What it does

The pull-request adds support for the stopDebugging VS Code API.
The API terminates the session if provided, else it will terminate all sessions.

How to test

  1. include the following vscode-stop-debugging test plugin
  2. start the application using theia as a workspace
  3. start a debug session (ex: using run mocha tests)
  4. execute the command Debug Test: Stop Active Session) - the session should terminate
  5. start multiple simultaneous debug sessions (ex: run mocha tests multiple times with different *.spec.ts files)
  6. execute the command Debug Test: Stop All Sessions) - all sessions should terminate

Review checklist

Reminder for reviewers

Signed-off-by: vince-fugnitto vincent.fugnitto@ericsson.com

The commit adds support for the `stopDebugging` vscode api.
The api can accept a debug session, and if none are provided it will
terminate all active sessions.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
@vince-fugnitto vince-fugnitto added vscode issues related to VSCode compatibility debug issues that related to debug functionality labels Jan 13, 2022
@vince-fugnitto vince-fugnitto self-assigned this Jan 13, 2022
Copy link
Contributor

@colin-grant-work colin-grant-work left a comment

Choose a reason for hiding this comment

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

The code looks good. With the example plugin, I was able to stop exactly one session or the all sessions as described.

@alvsan09 alvsan09 self-requested a review January 14, 2022 13:57
Copy link
Contributor

@alvsan09 alvsan09 left a comment

Choose a reason for hiding this comment

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

I have tested the two scenarios stopping the active session as well as all sessions and it works as expected 👍

The code looks good to me as well !!

@vince-fugnitto vince-fugnitto merged commit c56aa23 into master Jan 18, 2022
@vince-fugnitto vince-fugnitto deleted the vf/stopDebugging branch January 18, 2022 20:11
@github-actions github-actions bot added this to the 1.22.0 milestone Jan 18, 2022
}
// Terminate all sessions if no session is provided.
for (const session of this.sessionManager.sessions) {
this.sessionManager.terminateSession(session);
Copy link
Contributor

Choose a reason for hiding this comment

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

When $stopDebugging is called with a sessionId, the promise resolves when the session was terminated (or rejected). The promise might resolve earlier when calling the function without the sessionId arg. Maybe an await is missing from here.

Sorry for the noise if I am wrong 😊

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.

None yet

4 participants