-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Closed
Labels
debtCode quality issuesCode quality issuesdebugDebug viewlet, configurations, breakpoints, adapter issuesDebug viewlet, configurations, breakpoints, adapter issues
Milestone
Description
DebugService.createSession is only called from a single location in VS Code.
I wonder:
- why is only the body of
createSessionbracketed withthis.startInitializingState()/this.endInitializingState()and notstartDebugginginstead? - why are there two subsequent
saveAllcalls, one instartDebuggingand one increateSession? What can happen in between? - wouldn't it make sense to bring the
this.configurationManager.guessDebugger()and thethis.configurationManager.getDebugger(resolvedConfig.type)closer together without the intervening "SaveAll"?
In addition I see that startDebugging calls itself recursively. Here I wonder whether it is really needed to call this sequence again on every level?
I think this code structure would avoid the repetition of the run-once code:
startDebugging() {
// do some heavy preparation stuff
internalStart();
// do some error stuff at end
}
internalStart() {
if (composite) {
forAll() {
internalStart(); // the recursive call is here
}
} else {
createSession();
}
}
createSession() {
// start one session without repeating the heavy preparation stuff
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
debtCode quality issuesCode quality issuesdebugDebug viewlet, configurations, breakpoints, adapter issuesDebug viewlet, configurations, breakpoints, adapter issues