🎁 Add killOnServerStop to debug configuration#163779
🎁 Add killOnServerStop to debug configuration#163779roblourens merged 8 commits intomicrosoft:mainfrom
killOnServerStop to debug configuration#163779Conversation
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
killOnServerStop to debug configuration
killOnServerStop to debug configurationkillOnServerStop to debug configuration
| } | ||
| }); | ||
| this.lateDisposables.push(listener); // In case `trackerId` of interest was never caught anyhow. | ||
| }); |
There was a problem hiding this comment.
Applicable to here and below:
- The listener will be leaked if
startDebuggingreturns false - Even after the listener resolves,
lateDisposableswill keep growing indefinitely.
Maybe lateDisposables should be a Set that you can delete disposables from.
There was a problem hiding this comment.
You're right. Will push a fix soon.
There was a problem hiding this comment.
Made the changes as you suggested. the lateDisposables is a Set now. Also used vscode.CancellationToken for signaling whether to stop listening for events anymore.
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
connor4312
left a comment
There was a problem hiding this comment.
looks sane to me, cc @roblourens
| url: uri, | ||
| webRoot: session.configuration.serverReadyAction.webRoot || WEB_ROOT | ||
| webRoot: session.configuration.serverReadyAction.webRoot || WEB_ROOT, | ||
| trackerId, |
There was a problem hiding this comment.
Please use a more unique name for this. Since it's being added to another extension's launch config, I think it should reflect where it came from and the fact that it's sort of internal, I suggest _debugServerReadySessionId.
Actually it's interesting that startDebugging doesn't return a DebugSession, I sort of expected it would. That would make this easier.
There was a problem hiding this comment.
It would indeed. But getting an API change in for that would be awkward, we'd need to duplicate the method 😕
|
There's also a merge conflict here |
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Merged with the |
roblourens
left a comment
There was a problem hiding this comment.
Works great, thanks for this!
* 🎁 Add `killOnServerStop` to schema Signed-off-by: Babak K. Shandiz <[email protected]> * 📜 Add description for `killOnServerStop` Signed-off-by: Babak K. Shandiz <[email protected]> * 🔨 Stop created debug session on server stop Signed-off-by: Babak K. Shandiz <[email protected]> * 🔨 Push kill listeners into another disposable container Signed-off-by: Babak K. Shandiz <[email protected]> * 🐛 Prevent leak when new debug session fails to start Signed-off-by: Babak K. Shandiz <[email protected]> * 🔨 Use more verbose name for debug session tracker ID Signed-off-by: Babak K. Shandiz <[email protected]> Signed-off-by: Babak K. Shandiz <[email protected]>
* Remove i18n causing classifier to fail due to missing label * 🎁 Add `killOnServerStop` to debug configuration (#163779) * 🎁 Add `killOnServerStop` to schema Signed-off-by: Babak K. Shandiz <[email protected]> * 📜 Add description for `killOnServerStop` Signed-off-by: Babak K. Shandiz <[email protected]> * 🔨 Stop created debug session on server stop Signed-off-by: Babak K. Shandiz <[email protected]> * 🔨 Push kill listeners into another disposable container Signed-off-by: Babak K. Shandiz <[email protected]> * 🐛 Prevent leak when new debug session fails to start Signed-off-by: Babak K. Shandiz <[email protected]> * 🔨 Use more verbose name for debug session tracker ID Signed-off-by: Babak K. Shandiz <[email protected]> Signed-off-by: Babak K. Shandiz <[email protected]> * assign bhayva to getting started Signed-off-by: Babak K. Shandiz <[email protected]> Co-authored-by: Babak K. Shandiz <[email protected]>
Fixes #163124
A new configuration parameter, named
killOnServerStop, is added. When this parameter is enabled, child debug sessions will be stopped whenever the server (the parent session) stops. The default value for the parameter isfalseto keep the existing behavior unchanged.Verification
To verify this PR, use babakks/vscode-verify-kill-on-server-stop which is made for this purpose. Instructions are available in the
README.mdof the repo.