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

Add vscode API DebugSessionOptions #9613

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

msujew
Copy link
Member

@msujew msujew commented Jun 19, 2021

What it does

Closes #8518

Adds the vscode.debug.DebugSessionOptions API to Theia. This enables the following features:

  • Show child debug sessions as a tree under the parent sessions (Theia used to show them as siblings)
    • The new compact property will simplify the label and tree structure if possible
  • Different debug sessions no longer share the same DebugConsoleSession and therefore are displayed independently
    • Child debug sessions with the consoleMode property set to MergeWithParent will continue to share their console session with each other.
    • You can switch between console sessions with a selector, assuming more than one session is currently running.

The changes to DebugConsoleSession are slightly breaking. While it's still possible to simply inject the DebugConsoleSession directly, its tight coupling to DebugSession makes that impractical. Instead of injecting the DebugConsoleSession directly, a DebugConsoleSessionFactory allows to create a DebugConsoleSession with a provided DebugSession.

How to test

  1. Clone this test repo into Theia and make sure the vscode-js-debug extension is installed in Theia.
  2. Start a debugging session with the contained Launch Program configuration.
  3. Child processes will now be shown as a tree in the threads view.
  4. Start a second debugging session with the same configuration
  5. Another tree will appear in the threads view and you can switch between the different debug consoles.
  6. You can add configuration.consoleMode = undefined; and/or configuration.compact = undefined; after this line, and restart the server to test how these properties influence the debug console/view.

Review checklist

Reminder for reviewers

@vince-fugnitto vince-fugnitto added debug issues that related to debug functionality vscode issues related to VSCode compatibility labels Jun 21, 2021
@msujew msujew force-pushed the debug-session-options branch 3 times, most recently from f8c37b8 to 31a892d Compare June 25, 2021 10:45
@marcdumais-work
Copy link
Contributor

@paul-marechal @vince-fugnitto Could you help review?

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes look very promising, I only had the chance to quickly review so far and both the code and behavior look correct. I'd like to take some additional time looking more deeply at the code and reviewing additional use-cases.

packages/console/src/browser/console-session-manager.ts Outdated Show resolved Hide resolved
@msujew msujew force-pushed the debug-session-options branch 2 times, most recently from b17e25d to 12a9000 Compare July 6, 2021 11:28
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I confirmed that the behavior works as expected:

  • confirmed with the test workspace that launching multiple debug sessions works correctly, the threads display nested processes, and the output view contributes a toolbar item to select the different sessions.
  • confirmed that normal debug sessions (ex: _'run mocha tests') works as before

packages/plugin-ext/compile.tsconfig.json Outdated Show resolved Hide resolved
@vince-fugnitto
Copy link
Member

@msujew I believe if rebased it should fix the CI failures which have been resolved 👍

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I confirmed last week that the changes work as intended and the behavior is aligned with vscode 👍 The code is also very clean and I have no comments.

I'll let others review if interested :)

@msujew msujew force-pushed the debug-session-options branch 4 times, most recently from e384884 to 11b645e Compare July 15, 2021 08:50
@vince-fugnitto
Copy link
Member

@paul-marechal @colin-grant-work any additional comments? Else I'll merge the pull-request early this week.

@vince-fugnitto
Copy link
Member

@msujew the pull-request just needs to be rebased due to #8706.

@msujew
Copy link
Member Author

msujew commented Jul 20, 2021

@vince-fugnitto Thanks for the heads-up. Rebasing done 👍

@vince-fugnitto
Copy link
Member

I'll merge the pull-request tomorrow if there are no objections 👍

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 API completeness: startDebugging to respect DebugSessionOptions param
5 participants