Skip to content

Commit 00b2b4a

Browse files
authored
Merge pull request #5 from devchat-ai/feat/commit
Feat/commit
2 parents 46aca68 + dcaa9ec commit 00b2b4a

3 files changed

Lines changed: 329 additions & 271 deletions

File tree

src/util/ideaBridge.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,19 @@ const JStoIdea = {
240240
},
241241
};
242242

243+
window.JSJavaBridge.callJava(JSON.stringify(params));
244+
},
245+
userInput: (message) => {
246+
const params = {
247+
action: "input/request",
248+
metadata: {
249+
callback: "IdeaToJSMessage",
250+
},
251+
payload: {
252+
data: message?.text || "",
253+
},
254+
};
255+
243256
window.JSJavaBridge.callJava(JSON.stringify(params));
244257
},
245258
};
@@ -437,6 +450,7 @@ class IdeaBridge {
437450
}
438451

439452
sendMessage(message: any) {
453+
console.log("sendMessage message: ", message);
440454
// 根据 command 分发到不同的方法·
441455
switch (message.command) {
442456
// 发送消息
@@ -498,6 +512,9 @@ class IdeaBridge {
498512
case "openLink":
499513
JStoIdea.openLink(message);
500514
break;
515+
case "userInput":
516+
JStoIdea.userInput(message);
517+
break;
501518
default:
502519
break;
503520
}

0 commit comments

Comments
 (0)