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

Consider not having a singleton debugConsole #37279

Closed
jrieken opened this issue Oct 31, 2017 · 6 comments
Closed

Consider not having a singleton debugConsole #37279

jrieken opened this issue Oct 31, 2017 · 6 comments
Assignees
Labels
api debug Debug viewlet, configurations, breakpoints, adapter issues
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Oct 31, 2017

re #37167

Would it make sense to have the console on the DebugSession-type? It would still print to the (implementation-singleton) console but will allow us to have multiple consoles in the future (when multiple debug sessions are active). Something like this

export interface DebugSession {
  //...

  console: DebugConsole
}
@vscodebot vscodebot bot added the debug Debug viewlet, configurations, breakpoints, adapter issues label Oct 31, 2017
@weinand weinand added the api label Oct 31, 2017
@weinand
Copy link
Contributor

weinand commented Nov 1, 2017

Yep, I thought the same when starting to work on this API.

But then I noticed that the lifecycle of a DebugSession is the same as that of a debug adapter
which makes it impossible to output to the debug console before the debug adapter has started (and that is actually the main use case).

@weinand weinand added the under-discussion Issue is under discussion for relevance, priority, approach label Nov 3, 2017
@weinand
Copy link
Contributor

weinand commented Nov 21, 2017

I do not see an alternative to introducing the debug console singleton.
Closing.

@weinand weinand closed this as completed Nov 21, 2017
@jrieken
Copy link
Member Author

jrieken commented Nov 21, 2017

It is dangerous tho

@weinand
Copy link
Contributor

weinand commented Nov 21, 2017

Would it be better to use an activeDebugConsole instead?

@jrieken
Copy link
Member Author

jrieken commented Nov 21, 2017

Maybe... It at least signals that there can be (in the future) many and that they can change... If you ever want to support showing multiple debug consoles (which I think isn't a crazy request given that I can launch many debuggers at once) in parallel then the API shouldn't be in your way

@weinand
Copy link
Contributor

weinand commented Nov 21, 2017

Renamed vscode.debug.console to vscode.debug.activeDebugConsole.
There is no change event yet and the value of activeDebugConsole can never be undefined (to make the API not a pita to use).

@weinand weinand added this to the November 2017 milestone Nov 21, 2017
@weinand weinand removed the under-discussion Issue is under discussion for relevance, priority, approach label Nov 21, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

No branches or pull requests

2 participants