()
| 29 | * end user action for picking a process and attaching debugger to it |
| 30 | */ |
| 31 | export 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 |
nothing calls this directly
no test coverage detected