| 8 | import { UiProfileManager } from './profiling/uiProfileManager'; |
| 9 | |
| 10 | export const registerProfilingCommand = ( |
| 11 | context: vscode.ExtensionContext, |
| 12 | container: Container, |
| 13 | ) => { |
| 14 | const manager = container.get(UiProfileManager); |
| 15 | |
| 16 | context.subscriptions.push( |
| 17 | registerCommand(vscode.commands, Commands.StartProfile, sessionIdOrArgs => |
| 18 | manager.start( |
| 19 | typeof sessionIdOrArgs === 'string' |
| 20 | ? { sessionId: sessionIdOrArgs } |
| 21 | : sessionIdOrArgs ?? {}, |
| 22 | )), |
| 23 | registerCommand(vscode.commands, Commands.StopProfile, sessionId => manager.stop(sessionId)), |
| 24 | ); |
| 25 | }; |