( context: vscode.ExtensionContext, command: TerminalActionId, promptType: TerminalActionPromptType, )
| 14 | } |
| 15 | |
| 16 | const registerTerminalAction = ( |
| 17 | context: vscode.ExtensionContext, |
| 18 | command: TerminalActionId, |
| 19 | promptType: TerminalActionPromptType, |
| 20 | ) => { |
| 21 | context.subscriptions.push( |
| 22 | vscode.commands.registerCommand(getTerminalCommand(command), async (args: any) => { |
| 23 | let content = args?.selection |
| 24 | |
| 25 | if (!content || content === "") { |
| 26 | content = await Terminal.getTerminalContents(promptType === "TERMINAL_ADD_TO_CONTEXT" ? -1 : 1) |
| 27 | } |
| 28 | |
| 29 | if (!content) { |
| 30 | vscode.window.showWarningMessage(t("common:warnings.no_terminal_content")) |
| 31 | return |
| 32 | } |
| 33 | |
| 34 | await ClineProvider.handleTerminalAction(command, promptType, { |
| 35 | terminalContent: content, |
| 36 | }) |
| 37 | }), |
| 38 | ) |
| 39 | } |
no test coverage detected