Skip to content

Commit

Permalink
Merge pull request #217 from devchat-ai/feat/add-plugin-version-to-me…
Browse files Browse the repository at this point in the history
…ssage-event

feat: Add plugin version retrieval endpoint and update GUI submodule
  • Loading branch information
kagami-l authored Dec 27, 2024
2 parents c4028cd + 1af9a37 commit d2d08b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gui
12 changes: 12 additions & 0 deletions src/main/kotlin/ai/devchat/plugin/IDEServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit d2d08b4

Please sign in to comment.