Skip to content

Commit 887fe22

Browse files
committed
fix: update the javascript callback functions
1 parent a820e70 commit 887fe22

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

plugin/src/main/java/io/snyk/eclipse/plugin/html/CodeHtmlProvider.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,11 @@ private String getReplaceAIFixScripts(String html) {
8686
}
8787

8888
private String getGenerateAiFixScript() {
89-
// TODO this script is broken, does not trigger a generate
90-
return "const issueId = generateAIFixButton.getAttribute('issue-id');\n"
91-
+ "const folderPath = generateAIFixButton.getAttribute('folder-path');\n"
92-
+ "const filePath = generateAIFixButton.getAttribute('file-path');\n" + "console.log(filePath);\n"
93-
+ "window.generateAIFix(folderPath + \"@|@\" + filePath + \"@|@\" + issueId);";
89+
return "window.ideGenerateAIFix(generateFixQueryString)\n;";
9490
}
9591

9692
private String getApplyAiFixScript() {
97-
return "window.applyAIFix(fixId + '|@' + filePath + '|@' + patch);\n";
93+
return "window.ideApplyFix(fixId + '|@' + filePath + '|@' + patch);\n";
9894
}
9995

10096
}

plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/BrowserHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public Object function(Object[] arguments) {
9999
}
100100
};
101101

102-
new BrowserFunction(browser, "generateAIFix") {
102+
new BrowserFunction(browser, "ideGenerateAIFix") {
103103
@Override
104104
public Object function(Object[] arguments) {
105105
browser.execute("debugger;"); // Triggers a breakpoint for debugging
@@ -118,7 +118,7 @@ public Object function(Object[] arguments) {
118118
}
119119
};
120120

121-
new BrowserFunction(browser, "applyAIFix") {
121+
new BrowserFunction(browser, "ideApplyFix") {
122122
@Override
123123
public Object function(Object[] arguments) {
124124
System.out.println("applyAIFix");

0 commit comments

Comments
 (0)