Skip to content

Commit

Permalink
Get IDE service port
Browse files Browse the repository at this point in the history
  • Loading branch information
pplam committed Jun 16, 2024
1 parent c788c0c commit 1e4e6f8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gui
1 change: 1 addition & 0 deletions src/main/kotlin/ai/devchat/core/ActionHandlerFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ActionHandlerFactory {
DevChatActions.ADD_CONTEXT_REQUEST to AddContextRequestHandler::class,
DevChatActions.GET_KEY_REQUEST to GetKeyRequestHandler::class,
DevChatActions.COMMIT_CODE_REQUEST to CommitCodeRequestHandler::class,
DevChatActions.GET_IDE_SERVICE_PORT_REQUEST to GetIDEServicePortRequestHandler::class,
DevChatActions.GET_SETTING_REQUEST to GetSettingRequestHandler::class,
DevChatActions.UPDATE_SETTING_REQUEST to UpdateSettingRequestHandler::class,
DevChatActions.GET_SERVER_SETTINGS_REQUEST to GetServerSettingsRequestHandler::class,
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/ai/devchat/core/DevChatActions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ object DevChatActions {
const val GET_KEY_RESPONSE = "getKey/response"
const val COMMIT_CODE_REQUEST = "commitCode/request"
const val COMMIT_CODE_RESPONSE = "commitCode/response"
const val GET_IDE_SERVICE_PORT_REQUEST = "getIDEServicePort/request"
const val GET_IDE_SERVICE_PORT_RESPONSE = "getIDEServicePort/response"
const val GET_SETTING_REQUEST = "getSetting/request"
const val GET_SETTING_RESPONSE = "getSetting/response"
const val UPDATE_SETTING_REQUEST = "updateSetting/request"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ai.devchat.core.handlers

import ai.devchat.core.BaseActionHandler
import ai.devchat.core.DevChatActions
import ai.devchat.plugin.ideServerPort
import com.alibaba.fastjson.JSONObject



class GetIDEServicePortRequestHandler(requestAction: String, metadata: JSONObject?, payload: JSONObject?) : BaseActionHandler(
requestAction,
metadata,
payload
) {
override val actionName: String = DevChatActions.GET_IDE_SERVICE_PORT_RESPONSE
override fun action() {
send(payload= mapOf("port" to ideServerPort))
}
}

0 comments on commit 1e4e6f8

Please sign in to comment.