( response: DebugProtocol.TerminateResponse, args: DebugProtocol.TerminateArguments, )
| 488 | } |
| 489 | |
| 490 | protected async terminateRequest( |
| 491 | response: DebugProtocol.TerminateResponse, |
| 492 | args: DebugProtocol.TerminateArguments, |
| 493 | ): Promise<void> { |
| 494 | this.log(`Termination requested!`); |
| 495 | this.isTerminating = true; |
| 496 | this.startProgress(debugTerminatingProgressId, "Terminating debug session"); |
| 497 | |
| 498 | if (this.expectAdditionalPidToTerminate && !this.additionalPidsToTerminate.size) { |
| 499 | this.log(`Waiting for main process PID before terminating`); |
| 500 | this.updateProgress(debugTerminatingProgressId, "Waiting for process"); |
| 501 | const didGetPid = await this.raceIgnoringErrors(() => this.additionalPidCompleter.promise, 20000); |
| 502 | if (didGetPid) |
| 503 | this.log(`Got main process PID, continuing...`); |
| 504 | else |
| 505 | this.log(`Timed out waiting for main process PID, continuing anyway...`); |
| 506 | this.updateProgress(debugTerminatingProgressId, "Terminating process"); |
| 507 | } |
| 508 | |
| 509 | // If we wait for terminate() to complete, VS code will report a timeout after 1000ms |
| 510 | // so we have to acknowledge the request even if it takes longer to complete. |
| 511 | super.terminateRequest(response, args); |
| 512 | |
| 513 | try { |
| 514 | await this.terminate(false); |
| 515 | } catch (e: any) { |
| 516 | this.logger.error(e); |
| 517 | this.logToUser(errorString(e)); |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | protected async disconnectRequest( |
| 522 | response: DebugProtocol.DisconnectResponse, |
nothing calls this directly
no test coverage detected