diff --git a/gradle.properties b/gradle.properties index ece811a1a9..57b698d524 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,4 +24,4 @@ kotlin.stdlib.default.dependency=false nodeBinaries.commit=8755ae4c05fd476cd23f2972049111ba436c86d4 nodeBinaries.version=v20.12.2 cody.autocomplete.enableFormatting=true -cody.commit=a7ba3c987888439299edb6c215bb8b3ed4765d1d +cody.commit=7537429109d9eaf61da6daf49716abe169fbad6f diff --git a/src/main/java/com/sourcegraph/cody/agent/CodyAgentClient.java b/src/main/java/com/sourcegraph/cody/agent/CodyAgentClient.java index 100a10af1c..3bf4d9e144 100644 --- a/src/main/java/com/sourcegraph/cody/agent/CodyAgentClient.java +++ b/src/main/java/com/sourcegraph/cody/agent/CodyAgentClient.java @@ -5,6 +5,7 @@ import com.intellij.openapi.fileChooser.FileChooserFactory; import com.intellij.openapi.fileChooser.FileSaverDescriptor; import com.intellij.openapi.fileChooser.FileSaverDialog; +import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFileWrapper; import com.sourcegraph.cody.agent.protocol.*; import com.sourcegraph.cody.agent.protocol_generated.DisplayCodeLensParams; @@ -34,9 +35,11 @@ public class CodyAgentClient { private static final Logger logger = Logger.getInstance(CodyAgentClient.class); @NotNull NativeWebviewProvider webview; + Project project; - CodyAgentClient(@NotNull NativeWebviewProvider webviewProvider) { + CodyAgentClient(@NotNull NativeWebviewProvider webviewProvider, Project project) { this.webview = webviewProvider; + this.project = project; } // TODO: Remove this once we stop sniffing postMessage. diff --git a/src/main/kotlin/com/sourcegraph/cody/agent/CodyAgent.kt b/src/main/kotlin/com/sourcegraph/cody/agent/CodyAgent.kt index 161014355b..b5af836d82 100644 --- a/src/main/kotlin/com/sourcegraph/cody/agent/CodyAgent.kt +++ b/src/main/kotlin/com/sourcegraph/cody/agent/CodyAgent.kt @@ -103,7 +103,7 @@ private constructor( fun create(project: Project): CompletableFuture { try { val conn = startAgentProcess() - val client = CodyAgentClient(WebUIServiceWebviewProvider(project)) + val client = CodyAgentClient(WebUIServiceWebviewProvider(project), project) client.onSetConfigFeatures = project.service() val launcher = startAgentLauncher(conn, client) val server = launcher.remoteProxy diff --git a/src/test/kotlin/com/sourcegraph/cody/agent/CodyAgentClientTest.kt b/src/test/kotlin/com/sourcegraph/cody/agent/CodyAgentClientTest.kt index deea9b819e..f5ec841426 100644 --- a/src/test/kotlin/com/sourcegraph/cody/agent/CodyAgentClientTest.kt +++ b/src/test/kotlin/com/sourcegraph/cody/agent/CodyAgentClientTest.kt @@ -21,7 +21,7 @@ class CodyAgentClientTest : BasePlatformTestCase() { private val condition = lock.newCondition() private fun client(): CodyAgentClient { - val client = CodyAgentClient(StubWebviewProvider()) + val client = CodyAgentClient(StubWebviewProvider(), project) client.onSetConfigFeatures = ConfigFeaturesObserver { lock.lock() try {