diff --git a/gui b/gui index c883677..2f6f379 160000 --- a/gui +++ b/gui @@ -1 +1 @@ -Subproject commit c8836777f0d09ce1328166abec5cebc480a2590a +Subproject commit 2f6f379e917ace3d5a1dab1307c9446a08144d81 diff --git a/src/main/kotlin/ai/devchat/plugin/IDEServer.kt b/src/main/kotlin/ai/devchat/plugin/IDEServer.kt index abc7278..b3930bf 100644 --- a/src/main/kotlin/ai/devchat/plugin/IDEServer.kt +++ b/src/main/kotlin/ai/devchat/plugin/IDEServer.kt @@ -49,6 +49,7 @@ import java.awt.Point import java.io.File import java.net.ServerSocket import kotlin.reflect.full.memberFunctions +import com.intellij.ide.plugins.PluginManagerCore @Serializable @@ -98,6 +99,17 @@ class IDEServer(private var project: Project): Disposable { json() } routing { + post("/get_extension_version") { + val currentPlugin = try { + PluginManagerCore.getLoadedPlugins().find { plugin -> + plugin.pluginClassLoader == IDEServer::class.java.classLoader + } + } catch (e: Exception) { + null + } + call.respond(Result(currentPlugin?.version ?: "unknown")) + } + post("/find_def_locations") { val body: ReqLocation = call.receive() val definitions = try {