MCPcopy Create free account
hub / github.com/Snapchat/Valdi / attachProcess

Function attachProcess

valdi/vscode_debugger/src/ui/processPicker.ts:31–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 * end user action for picking a process and attaching debugger to it
30 */
31export async function attachProcess() {
32 // We pick here, rather than just putting the command as the process ID, so
33 // that the cwd is set correctly in multi-root workspaces.
34 const processId = await pickProcess();
35 if (!processId) {
36 return;
37 }
38
39 const userDefaults = readConfig(vscode.workspace, Configuration.PickAndAttachDebugOptions);
40
41 const config: INodeAttachConfiguration = {
42 ...nodeAttachConfigDefaults,
43 ...userDefaults,
44 name: 'process',
45 processId,
46 };
47
48 await resolveProcessId(config, true);
49 await vscode.debug.startDebugging(
50 config.cwd ? vscode.workspace.getWorkspaceFolder(vscode.Uri.file(config.cwd)) : undefined,
51 config,
52 );
53}
54
55/**
56 * Resolves the requested process ID, and updates the config object

Callers

nothing calls this directly

Calls 4

readConfigFunction · 0.90
pickProcessFunction · 0.85
resolveProcessIdFunction · 0.85
fileMethod · 0.80

Tested by

no test coverage detected