Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add plugin version retrieval endpoint and update GUI submodule #217

Merged
merged 2 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading