Skip to content

Commit 8c5cf0b

Browse files
committed
fix: rename FolderConfigs
1 parent 04e63f7 commit 8c5cf0b

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

plugin/src/main/java/io/snyk/eclipse/plugin/properties/preferences/FolderConfigs.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,10 @@ public String getBaseBranch(String folderPath) {
6767
FolderConfig folderConfig = gson.fromJson(json, FolderConfig.class);
6868
return folderConfig.getBaseBranch();
6969
}
70+
71+
public void addAll(List<FolderConfig> folderConfigs) {
72+
for (FolderConfig folderConfig : folderConfigs) {
73+
addFolderConfig(folderConfig);
74+
}
75+
}
7076
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public void reset() {
2020
if (openProjects.isEmpty()) {
2121
var contentRoot = new ContentRootNode("No projects in workspace to scan", null);
2222
this.addChild(contentRoot);
23+
return;
2324
}
2425

2526
for (IProject project : openProjects) {

plugin/src/main/java/io/snyk/languageserver/LsConfigurationUpdater.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Settings getCurrentSettings() {
5656
if (useTokenAuth) {
5757
authMethod = "token";
5858
}
59-
String enableDeltaFindings = preferences.getPref(Preferences.FILTER_DELTA_NEW_ISSUES, "");
59+
String enableDeltaFindings = preferences.getPref(Preferences.FILTER_DELTA_NEW_ISSUES, Boolean.FALSE.toString());
6060
return new Settings(activateSnykOpenSource, activateSnykCodeSecurity, activateSnykCodeQuality, activateSnykIac, insecure, endpoint, additionalParams,
6161
additionalEnv, path, sendErrorReports, enableTelemetry, organization, manageBinariesAutomatically, cliPath,
6262
token, integrationName, integrationVersion, automaticAuthentication, trustedFolders, enableTrustedFolderFeature,

plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
import io.snyk.eclipse.plugin.analytics.AbstractTask;
7070
import io.snyk.eclipse.plugin.analytics.AnalyticsEventTask;
7171
import io.snyk.eclipse.plugin.analytics.TaskProcessor;
72-
import io.snyk.eclipse.plugin.properties.preferences.EclipsePreferenceState;
72+
import io.snyk.eclipse.plugin.properties.preferences.FolderConfigs;
7373
import io.snyk.eclipse.plugin.properties.preferences.Preferences;
7474
import io.snyk.eclipse.plugin.utils.SnykLogger;
7575
import io.snyk.eclipse.plugin.views.snyktoolview.FileTreeNode;
@@ -109,7 +109,7 @@ public class SnykExtendedLanguageClient extends LanguageClientImpl {
109109
// this field is for testing only
110110
private LanguageServer ls;
111111
private LsConfigurationUpdater configurationUpdater = new LsConfigurationUpdater();
112-
private EclipsePreferenceState preferenceState = EclipsePreferenceState.getInstance();
112+
private FolderConfigs preferenceState = FolderConfigs.getInstance();
113113

114114
private static SnykExtendedLanguageClient instance = null;
115115

@@ -388,13 +388,7 @@ public void snykScan(SnykScanParam param) {
388388
@JsonNotification(value = LsNotificationID.SNYK_FOLDER_CONFIG)
389389
public void folderConfig(FolderConfigsParam folderConfigParam) {
390390
List<FolderConfig> folderConfigs = folderConfigParam != null ? folderConfigParam.getFolderConfigs() : List.of();
391-
CompletableFuture.runAsync(() -> addAll(folderConfigs));
392-
}
393-
394-
public void addAll(List<FolderConfig> folderConfigs) {
395-
for (FolderConfig folderConfig : folderConfigs) {
396-
preferenceState.addFolderConfig(folderConfig);
397-
}
391+
CompletableFuture.runAsync(() -> FolderConfigs.getInstance().addAll(folderConfigs));
398392
}
399393

400394
private void openToolView() {

0 commit comments

Comments
 (0)