File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
233/main/resources/META-INF
main/kotlin/cc/unitmesh/devti/mcp Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 80
80
<httpRequestHandler implementation =" cc.unitmesh.devti.mcp.host.MCPService" />
81
81
<postStartupActivity implementation =" cc.unitmesh.devti.update.AutoDevUpdateStartupActivity" />
82
82
<postStartupActivity implementation =" cc.unitmesh.devti.mcp.MCPServerStartupValidator" />
83
+ <jbProtocolCommand implementation =" cc.unitmesh.devti.mcp.AutoDevJbProtocolService" />
83
84
<notificationGroup id =" UnitMesh.MCPServer" displayType =" BALLOON" />
84
85
</extensions >
85
86
Original file line number Diff line number Diff line change
1
+ package cc.unitmesh.devti.mcp
2
+
3
+ import cc.unitmesh.devti.mcp.host.IssueArgs
4
+ import cc.unitmesh.devti.mcp.host.IssueEvaluateTool
5
+ import com.intellij.openapi.application.JBProtocolCommand
6
+ import com.intellij.openapi.project.ProjectManager
7
+
8
+ class AutoDevJbProtocolService : JBProtocolCommand (" autodev" ) {
9
+ override suspend fun execute (
10
+ target : String? ,
11
+ parameters : Map <String , String >,
12
+ fragment : String?
13
+ ): String? {
14
+ val issueEvaluateTool = IssueEvaluateTool ()
15
+ val issue = parameters[" issue" ]
16
+ if (issue == null ) {
17
+ return null
18
+ }
19
+
20
+ val args: IssueArgs = IssueArgs (issue = issue)
21
+
22
+ val project = ProjectManager .getInstance().openProjects.firstOrNull()
23
+ ? : return null
24
+ val result = issueEvaluateTool.handle(project, args)
25
+ return result.toString()
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments