MCPcopy
hub / github.com/dotnet/vscode-csharp / killProcess

Function killProcess

src/razor/src/blazorDebug/terminateDebugHandler.ts:17–29  ·  view source on GitHub ↗
(targetPid: number | undefined, logger: RazorLogger)

Source from the content-addressed store, hash-verified

15};
16
17const killProcess = (targetPid: number | undefined, logger: RazorLogger) => {
18 // If no PID was provided, then exit early.
19 if (!targetPid) {
20 return;
21 }
22
23 try {
24 logger.logTrace(`[DEBUGGER] Terminating debugging session with PID ${targetPid}...`);
25 process.kill(targetPid);
26 } catch (error) {
27 logger.logError(`[DEBUGGER] Error terminating debug processes with PID ${targetPid}: `, error as Error);
28 }
29};
30
31export async function onDidTerminateDebugSession(
32 event: DebugSession,

Callers 2

terminateByPidFunction · 0.85
terminateByProcessNameFunction · 0.85

Calls 2

logTraceMethod · 0.80
logErrorMethod · 0.80

Tested by

no test coverage detected