From 9d79b5697e137e36f1f14f652a7ac6ffaded94a7 Mon Sep 17 00:00:00 2001 From: Rik Nauta Date: Thu, 8 Aug 2024 15:12:22 +0200 Subject: [PATCH] Handle edit result --- .../com/sourcegraph/cody/inspections/CodeActionQuickFix.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/sourcegraph/cody/inspections/CodeActionQuickFix.kt b/src/main/kotlin/com/sourcegraph/cody/inspections/CodeActionQuickFix.kt index 498b235d15..9cc162495a 100644 --- a/src/main/kotlin/com/sourcegraph/cody/inspections/CodeActionQuickFix.kt +++ b/src/main/kotlin/com/sourcegraph/cody/inspections/CodeActionQuickFix.kt @@ -10,6 +10,7 @@ import com.sourcegraph.cody.agent.CodyAgentService import com.sourcegraph.cody.agent.protocol_generated.CodeActions_ProvideParams import com.sourcegraph.cody.agent.protocol_generated.CodeActions_TriggerParams import com.sourcegraph.cody.agent.protocol_generated.ProtocolLocation +import com.sourcegraph.cody.edit.actions.EditCodeAction data class CodeActionQuickFixParams( val title: String, @@ -102,7 +103,8 @@ class CodeActionQuickFix(private val params: CodeActionQuickFixParams) : throw Exception("Could not find action") } // TODO: Need to refactor agent to not return edit session for every action CODY-3125 - agent.server.codeActions_trigger(CodeActions_TriggerParams(id = action.id)) + val result = agent.server.codeActions_trigger(CodeActions_TriggerParams(id = action.id)).get() + EditCodeAction.completedEditTasks[result.id] = result } } }