|
3 | 3 | import static org.apache.commons.lang3.StringUtils.isEmpty;
|
4 | 4 |
|
5 | 5 | import java.nio.file.Paths;
|
6 |
| -import java.util.List; |
| 6 | +import java.util.Collections; |
7 | 7 | import java.util.concurrent.CompletableFuture;
|
8 | 8 |
|
9 | 9 | import org.eclipse.core.commands.common.CommandException;
|
|
33 | 33 | import io.snyk.eclipse.plugin.views.snyktoolview.handlers.IHandlerCommands;
|
34 | 34 | import io.snyk.eclipse.plugin.wizards.SnykWizard;
|
35 | 35 | import io.snyk.languageserver.protocolextension.SnykExtendedLanguageClient;
|
36 |
| -import io.snyk.languageserver.protocolextension.messageObjects.Fix; |
37 | 36 |
|
38 | 37 | @SuppressWarnings("restriction")
|
39 | 38 | public class BrowserHandler {
|
@@ -102,33 +101,26 @@ public Object function(Object[] arguments) {
|
102 | 101 | new BrowserFunction(browser, "ideGenAIFix") {
|
103 | 102 | @Override
|
104 | 103 | public Object function(Object[] arguments) {
|
105 |
| - // browser.execute("debugger;"); // Triggers a breakpoint for debugging |
106 |
| - System.out.println("generateAIFix"); |
107 |
| - SnykLogger.logInfo("generateAIFix"); |
108 |
| - |
109 | 104 | String params = (String) arguments[0];
|
110 | 105 | String[] parts = params.split("@|@");
|
111 |
| - |
112 | 106 | String folderURI = (String) parts[0];
|
113 | 107 | String fileURI = (String) parts[2];
|
114 | 108 | String issueID = (String) parts[4];
|
115 | 109 |
|
116 |
| - SnykExtendedLanguageClient.getInstance().sendCodeFixDiffsCommand(folderURI, |
117 |
| - fileURI, issueID); |
| 110 | + SnykExtendedLanguageClient.getInstance().sendCodeFixDiffsCommand(folderURI, fileURI, issueID); |
118 | 111 |
|
119 |
| - return null; |
| 112 | + return Collections.emptyList(); |
120 | 113 | }
|
121 | 114 | };
|
122 | 115 |
|
123 | 116 | new BrowserFunction(browser, "ideApplyFix") {
|
124 | 117 | @Override
|
125 | 118 | public Object function(Object[] arguments) {
|
126 |
| - System.out.println("applyAIFix"); |
127 |
| - SnykLogger.logInfo("applyAIFix"); |
128 |
| - |
129 | 119 | String fixId = (String) arguments[0];
|
| 120 | + |
130 | 121 | SnykExtendedLanguageClient.getInstance().sendCodeApplyAiFixEditCommand(fixId);
|
131 |
| - return null; |
| 122 | + |
| 123 | + return Collections.emptyList(); |
132 | 124 | }
|
133 | 125 | };
|
134 | 126 |
|
|
0 commit comments