MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / handleCodeAction

Method handleCodeAction

src/core/webview/ClineProvider.ts:714–744  ·  view source on GitHub ↗
(
		command: CodeActionId,
		promptType: CodeActionName,
		params: Record<string, string | any[]>,
	)

Source from the content-addressed store, hash-verified

712 }
713
714 public static async handleCodeAction(
715 command: CodeActionId,
716 promptType: CodeActionName,
717 params: Record<string, string | any[]>,
718 ): Promise<void> {
719 // Capture telemetry for code action usage
720 TelemetryService.instance.captureCodeActionUsed(promptType)
721
722 const visibleProvider = await ClineProvider.getInstance()
723
724 if (!visibleProvider) {
725 return
726 }
727
728 const { customSupportPrompts } = await visibleProvider.getState()
729
730 // TODO: Improve type safety for promptType.
731 const prompt = supportPrompt.create(promptType, params, customSupportPrompts)
732
733 if (command === "addToContext") {
734 await visibleProvider.postMessageToWebview({
735 type: "invoke",
736 invoke: "setChatBoxMessage",
737 text: `${prompt}\n\n`,
738 })
739 await visibleProvider.postMessageToWebview({ type: "action", action: "focusInput" })
740 return
741 }
742
743 await visibleProvider.createTask(prompt)
744 }
745
746 public static async handleTerminalAction(
747 command: TerminalActionId,

Callers 2

registerCodeActionFunction · 0.80
handleNewTaskFunction · 0.80

Calls 6

captureCodeActionUsedMethod · 0.80
postMessageToWebviewMethod · 0.80
getStateMethod · 0.65
createTaskMethod · 0.65
getInstanceMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected