diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/META-INF/MANIFEST.MF b/eclipse-language-servers/org.springframework.tooling.boot.ls/META-INF/MANIFEST.MF
index d73d73d4e..63cee3ad3 100644
--- a/eclipse-language-servers/org.springframework.tooling.boot.ls/META-INF/MANIFEST.MF
+++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/META-INF/MANIFEST.MF
@@ -32,7 +32,8 @@ Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0",
com.google.gson,
org.eclipse.lsp4e.jdt;bundle-version="0.10.0",
org.springsource.ide.eclipse.commons.boot.ls,
- org.springframework.ide.eclipse.editor.support
+ org.springframework.ide.eclipse.editor.support,
+ com.google.guava
Import-Package: com.google.common.base,
com.google.common.collect,
com.google.gson;version="2.7.0",
diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/plugin.xml b/eclipse-language-servers/org.springframework.tooling.boot.ls/plugin.xml
index a1b321030..7f174019f 100644
--- a/eclipse-language-servers/org.springframework.tooling.boot.ls/plugin.xml
+++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/plugin.xml
@@ -132,24 +132,6 @@
name="Spring Boot Language Server">
-
-
-
-
-
-
diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/BootLanguageServerPlugin.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/BootLanguageServerPlugin.java
index 880dfd773..ba530bdff 100644
--- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/BootLanguageServerPlugin.java
+++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/BootLanguageServerPlugin.java
@@ -21,6 +21,7 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
+import org.springframework.tooling.boot.ls.prefs.CategoryProblemsSeverityPrefsPage;
/**
* Boot-Java LS extension plugin
@@ -51,7 +52,11 @@ public class BootLanguageServerPlugin extends AbstractUIPlugin {
super.start(context);
deactivateDuplicateKeybindings();
BootJavaPreferencesPage.manageCodeMiningPreferences();
+
+ CategoryProblemsSeverityPrefsPage.loadProblemCategoriesIntoPreferences();
}
+
+
@Override
public void stop(BundleContext context) throws Exception {
diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/DelegatingStreamConnectionProvider.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/DelegatingStreamConnectionProvider.java
index 1fa5b70a4..fc08a5db8 100644
--- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/DelegatingStreamConnectionProvider.java
+++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/DelegatingStreamConnectionProvider.java
@@ -22,7 +22,6 @@ import java.util.Map;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -32,6 +31,9 @@ import org.eclipse.lsp4j.InitializeResult;
import org.eclipse.lsp4j.jsonrpc.messages.Message;
import org.eclipse.lsp4j.jsonrpc.messages.ResponseMessage;
import org.eclipse.lsp4j.services.LanguageServer;
+import org.springframework.tooling.boot.ls.prefs.CategoryProblemsSeverityPrefsPage;
+import org.springframework.tooling.boot.ls.prefs.ProblemCategoryData;
+import org.springframework.tooling.boot.ls.prefs.ProblemCategoryData.CategoryToggleData;
import org.springframework.tooling.ls.eclipse.commons.LanguageServerCommonsActivator;
import org.springsource.ide.eclipse.commons.boot.ls.remoteapps.RemoteBootAppsDataHolder;
import org.springsource.ide.eclipse.commons.boot.ls.remoteapps.RemoteBootAppsDataHolder.RemoteAppData;
@@ -194,6 +196,7 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
settings.put("boot-java", bootJavaObj);
putValidationPreferences(settings);
+ putValidationCategoryToggles(settings);
this.languageServer.getWorkspaceService().didChangeConfiguration(new DidChangeConfigurationParams(settings));
}
@@ -213,6 +216,23 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
Log.log(e);
}
}
+
+ private void putValidationCategoryToggles(Map settings) {
+ try {
+ IEclipsePreferences prefs = BootLanguageServerPlugin.getPreferences();
+ for (ProblemCategoryData category : CategoryProblemsSeverityPrefsPage.ALL_PROBLEM_CATEGORIES) {
+ if (category.getToggle() != null) {
+ CategoryToggleData toggle = category.getToggle();
+ String val = prefs.get(toggle.getPreferenceKey(), null);
+ if (val != null) {
+ dotPut(settings, toggle.getPreferenceKey(), val);
+ }
+ }
+ }
+ } catch (Exception e) {
+ Log.log(e);
+ }
+ }
private void dotPut(Object _settings, String dottedProperty, Object value) {
if (_settings instanceof Map) {
diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/ApplicationPropertiesEditorProblemSeverityPrefsPage.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/ApplicationPropertiesEditorProblemSeverityPrefsPage.java
deleted file mode 100644
index d2ba1a41d..000000000
--- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/ApplicationPropertiesEditorProblemSeverityPrefsPage.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2020 Pivotal, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Pivotal, Inc. - initial API and implementation
- *******************************************************************************/
-package org.springframework.tooling.boot.ls.prefs;
-
-import java.io.IOException;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferencesUtil;
-import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferityPageFromMetadata;
-import org.springframework.tooling.boot.ls.BootLanguageServerPlugin;
-
-public class ApplicationPropertiesEditorProblemSeverityPrefsPage extends ProblemSeverityPreferityPageFromMetadata {
-
- public static final ProblemSeverityPreferencesUtil util = new ProblemSeverityPreferencesUtil("problem.properties.");
-
- public ApplicationPropertiesEditorProblemSeverityPrefsPage() throws IOException {
- super(util, LanguageServerProblemTypesMetadata.load().get("application-properties"));
- }
-
- @Override
- protected String getPluginId() {
- return BootLanguageServerPlugin.PLUGIN_ID;
- }
-
-}
diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/ApplicationYamlEditorProblemSeverityPrefsPage.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/ApplicationYamlEditorProblemSeverityPrefsPage.java
deleted file mode 100644
index 2922e8413..000000000
--- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/ApplicationYamlEditorProblemSeverityPrefsPage.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2020 Pivotal, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Pivotal, Inc. - initial API and implementation
- *******************************************************************************/
-package org.springframework.tooling.boot.ls.prefs;
-
-import java.io.IOException;
-
-import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferencesUtil;
-import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferityPageFromMetadata;
-import org.springframework.tooling.boot.ls.BootLanguageServerPlugin;
-
-public class ApplicationYamlEditorProblemSeverityPrefsPage extends ProblemSeverityPreferityPageFromMetadata {
-
- public static final ProblemSeverityPreferencesUtil util = new ProblemSeverityPreferencesUtil("problem.yaml.");
-
- public ApplicationYamlEditorProblemSeverityPrefsPage() throws IOException {
- super(util, LanguageServerProblemTypesMetadata.load().get("application-yaml"));
- }
-
- @Override
- protected String getPluginId() {
- return BootLanguageServerPlugin.PLUGIN_ID;
- }
-}
diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/CategoryProblemsSeverityPrefsPage.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/CategoryProblemsSeverityPrefsPage.java
new file mode 100644
index 000000000..2ea327034
--- /dev/null
+++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/CategoryProblemsSeverityPrefsPage.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2022 VMware, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.springframework.tooling.boot.ls.prefs;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.jface.preference.ComboFieldEditor;
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.jface.preference.PreferenceNode;
+import org.eclipse.ui.PlatformUI;
+import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferencesUtil;
+import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferityPageFromMetadata;
+import org.springframework.tooling.boot.ls.BootLanguageServerPlugin;
+import org.springframework.tooling.boot.ls.prefs.ProblemCategoryData.CategoryToggleData;
+
+import com.google.common.collect.ImmutableList;
+
+public class CategoryProblemsSeverityPrefsPage extends ProblemSeverityPreferityPageFromMetadata {
+
+ public static ImmutableList ALL_PROBLEM_CATEGORIES;
+
+ private static final String PREF_KEY_PREFIX = "";
+
+ private ProblemCategoryData category;
+
+ public CategoryProblemsSeverityPrefsPage(ProblemCategoryData category) {
+ super(new ProblemSeverityPreferencesUtil("problem." + category.getId() + "."), category.getProblemTypes());
+ this.category = category;
+ setTitle(category.getLabel());
+ }
+
+ @Override
+ protected String getPluginId() {
+ return BootLanguageServerPlugin.PLUGIN_ID;
+ }
+
+ @Override
+ protected void initializeDefaults() {
+ if (category.getToggle() != null) {
+ IEclipsePreferences defaults = DefaultScope.INSTANCE.getNode(getPluginId());
+ defaults.put(PREF_KEY_PREFIX + category.getToggle().getPreferenceKey(), category.getToggle().getDefaultValue());
+
+ }
+ super.initializeDefaults();
+ }
+
+ @Override
+ protected void createFieldEditors() {
+ if (category.getToggle() != null) {
+ CategoryToggleData toggle = category.getToggle();
+ ComboFieldEditor field = new ComboFieldEditor(
+ PREF_KEY_PREFIX + toggle.getPreferenceKey(),
+ toggle.getLabel(),
+ createToggleValues(toggle.getValues()),
+ getFieldEditorParent()
+ );
+ addField(field);
+ }
+ super.createFieldEditors();
+ }
+
+ private static String[][] createToggleValues(String[] values) {
+ String[][] res = new String[values.length][2];
+ for (int i = 0; i < values.length; i++) {
+ String value = values[i];
+ res[i][0] = value.substring(0, 1).toUpperCase() + value.substring(1).toLowerCase();
+ res[i][1] = value;
+ }
+ return res;
+ }
+
+ public static void loadProblemCategoriesIntoPreferences() throws Exception {
+ List categories = LanguageServerProblemTypesMetadata.load();
+
+ Collections.sort(categories, (e1, e2) -> e1.getOrder() - e2.getOrder());
+
+ for (ProblemCategoryData categoryData : categories) {
+
+ //create a new PreferenceNode that will appear in the Preference window
+ PreferenceNode node = new PreferenceNode(BootLanguageServerPlugin.PLUGIN_ID + "." + categoryData.getId()) {
+
+ @Override
+ public void createPage() {
+ CategoryProblemsSeverityPrefsPage page = new CategoryProblemsSeverityPrefsPage(categoryData);
+ page.init(PlatformUI.getWorkbench());
+ page.setTitle(getLabelText());
+ setPage(page);
+ }
+
+ @Override
+ public String getLabelText() {
+ return categoryData.getLabel();
+ }
+
+ };
+
+ //use workbenches's preference manager
+ PreferenceManager pm= PlatformUI.getWorkbench().getPreferenceManager();
+
+ pm.addTo("org.eclipse.lsp4e.preferences/org.springframework.tooling.ls.eclipse.commons.console.preferences/org.springframework.tooling.boot.ls.preferences", node); //add the node in the PreferenceManager
+ }
+
+ ALL_PROBLEM_CATEGORIES = ImmutableList.copyOf(categories);
+ }
+
+
+}
diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/LanguageServerProblemTypesMetadata.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/LanguageServerProblemTypesMetadata.java
index 0dd7df988..eef0e03d9 100644
--- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/LanguageServerProblemTypesMetadata.java
+++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/LanguageServerProblemTypesMetadata.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2020 Pivotal, Inc.
+ * Copyright (c) 2020, 2022 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,19 +11,35 @@
package org.springframework.tooling.boot.ls.prefs;
import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
import java.io.IOException;
-import java.util.Map;
+import java.io.Reader;
+import java.util.List;
import org.eclipse.core.runtime.FileLocator;
-import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferityPageFromMetadata.ProblemTypeData;
import org.springframework.tooling.boot.ls.BootLanguageServerPlugin;
+import com.google.common.reflect.TypeToken;
+import com.google.gson.Gson;
+
public class LanguageServerProblemTypesMetadata {
- public static Map load() throws IOException {
+ public static List load() throws IOException {
File root = FileLocator.getBundleFile(BootLanguageServerPlugin.getDefault().getBundle());
File metadataFile = root.toPath().resolve("servers/spring-boot-language-server/BOOT-INF/classes/problem-types.json").toFile();
- return ApplicationPropertiesEditorProblemSeverityPrefsPage.readFromFile(metadataFile);
+ return readCategoriesFromFile(metadataFile);
+ }
+
+ public static List readCategoriesFromFile(File metadataFile) throws FileNotFoundException, IOException {
+ Gson gson = new Gson();
+ TypeToken> tt = new TypeToken>() {
+ private static final long serialVersionUID = 1L;
+ };
+ try (Reader json = new FileReader(metadataFile)) {
+ return gson.fromJson(json, tt.getType());
+ }
}
+
}
diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/ProblemCategoryData.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/ProblemCategoryData.java
new file mode 100644
index 000000000..9ee758116
--- /dev/null
+++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/ProblemCategoryData.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2022 VMware, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.springframework.tooling.boot.ls.prefs;
+
+import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferityPageFromMetadata.ProblemTypeData;
+
+public class ProblemCategoryData {
+ private String id;
+ private String label;
+ private String description;
+ private CategoryToggleData toggle;
+ private int order;
+ private ProblemTypeData[] problemTypes;
+
+ ProblemCategoryData() {}
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public CategoryToggleData getToggle() {
+ return toggle;
+ }
+
+ public int getOrder() {
+ return order;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public ProblemTypeData[] getProblemTypes() {
+ return problemTypes;
+ }
+
+ public static class CategoryToggleData {
+ private String label;
+
+ private String[] values;
+
+ private String preferenceKey;
+
+ private String defaultValue;
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String[] getValues() {
+ return values;
+ }
+
+ public String getPreferenceKey() {
+ return preferenceKey;
+ }
+
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ }
+
+}
diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/SpringJavaProblemSeverityPrefsPage.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/SpringJavaProblemSeverityPrefsPage.java
deleted file mode 100644
index a98da96a7..000000000
--- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/SpringJavaProblemSeverityPrefsPage.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2020 Pivotal, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Pivotal, Inc. - initial API and implementation
- *******************************************************************************/
-package org.springframework.tooling.boot.ls.prefs;
-
-import java.io.IOException;
-
-import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferencesUtil;
-import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferityPageFromMetadata;
-import org.springframework.tooling.boot.ls.BootLanguageServerPlugin;
-
-public class SpringJavaProblemSeverityPrefsPage extends ProblemSeverityPreferityPageFromMetadata {
-
- public static final ProblemSeverityPreferencesUtil util = new ProblemSeverityPreferencesUtil("problem.java.");
-
- public SpringJavaProblemSeverityPrefsPage() throws IOException {
- super(util, LanguageServerProblemTypesMetadata.load().get("java"));
- }
-
- @Override
- protected String getPluginId() {
- return BootLanguageServerPlugin.PLUGIN_ID;
- }
-
-}
diff --git a/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshCloudConfigSchema.java b/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshCloudConfigSchema.java
index db768edcc..2c6dd7135 100644
--- a/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshCloudConfigSchema.java
+++ b/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshCloudConfigSchema.java
@@ -130,7 +130,7 @@ public class BoshCloudConfigSchema extends SchemaSupport implements YamlSchema {
ASTTypeCache astTypes = models.astTypes;
for (YType defType : getDefinitionTypes()) {
- toplevelType.require(Constraints.uniqueDefinition(astTypes, defType, YamlSchemaProblems.problemType("BOSH_CC_DUPLICATE_"+defType)));
+ toplevelType.require(Constraints.uniqueDefinition(astTypes, defType, YamlSchemaProblems.problemType("BOSH_CC_DUPLICATE_"+defType, BoshSchemaProblems.CATEGORY)));
}
}
diff --git a/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshDeploymentManifestSchema.java b/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshDeploymentManifestSchema.java
index 5d56bb6bf..9804bf8cc 100644
--- a/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshDeploymentManifestSchema.java
+++ b/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshDeploymentManifestSchema.java
@@ -321,7 +321,7 @@ public class BoshDeploymentManifestSchema extends SchemaSupport implements YamlS
}
for (YType defType : getDefinitionTypes()) {
- v2Schema.require(Constraints.uniqueDefinition(this.astTypes, defType, YamlSchemaProblems.problemType("BOSH_DUPLICATE_"+defType)));
+ v2Schema.require(Constraints.uniqueDefinition(this.astTypes, defType, YamlSchemaProblems.problemType("BOSH_DUPLICATE_"+defType, BoshSchemaProblems.CATEGORY)));
}
return v2Schema;
}
diff --git a/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshSchemaProblems.java b/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshSchemaProblems.java
index c49cba1d6..1dfd3b1a5 100644
--- a/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshSchemaProblems.java
+++ b/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshSchemaProblems.java
@@ -10,12 +10,15 @@
*******************************************************************************/
package org.springframework.ide.vscode.bosh;
+import org.springframework.ide.vscode.commons.languageserver.reconcile.ProblemCategory;
import org.springframework.ide.vscode.commons.languageserver.reconcile.ProblemSeverity;
import org.springframework.ide.vscode.commons.languageserver.reconcile.ProblemType;
import org.springframework.ide.vscode.commons.yaml.reconcile.YamlSchemaProblems;
public class BoshSchemaProblems {
+
+ public static final ProblemCategory CATEGORY = new ProblemCategory("bosh", "Bosh YAML Validation", null);
- public static final ProblemType MISSING_SHA1_PROPERTY = YamlSchemaProblems.problemType("MISSING_SHA1_PROPERTY", ProblemSeverity.WARNING);
+ public static final ProblemType MISSING_SHA1_PROPERTY = YamlSchemaProblems.problemType("MISSING_SHA1_PROPERTY", ProblemSeverity.WARNING, CATEGORY);
}
diff --git a/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/reconcile/BadWordReconcileEngine.java b/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/reconcile/BadWordReconcileEngine.java
index 77be5accb..bae2feaec 100644
--- a/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/reconcile/BadWordReconcileEngine.java
+++ b/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/reconcile/BadWordReconcileEngine.java
@@ -46,6 +46,11 @@ public class BadWordReconcileEngine implements IReconcileEngine {
public String getLabel() {
return "Bad label";
}
+
+ @Override
+ public ProblemCategory getCategory() {
+ return null;
+ }
}
private final String[] BADWORDS = {
diff --git a/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/reconcile/ProblemCategory.java b/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/reconcile/ProblemCategory.java
new file mode 100644
index 000000000..a0430676b
--- /dev/null
+++ b/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/reconcile/ProblemCategory.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2022 VMware, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.springframework.ide.vscode.commons.languageserver.reconcile;
+
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public final class ProblemCategory {
+
+ private static AtomicInteger counter = new AtomicInteger();
+
+ public static final ProblemCategory NO_CATEGORY = new ProblemCategory("uncategorized", "Uncategorized", null);
+
+ final private String id;
+
+ final private String label;
+
+ final private List problemTypes = new ArrayList<>();;
+
+ final private Toggle toggle;
+
+ final public int order;
+
+ public ProblemCategory(String id, String label, Toggle toggle) {
+ this.id = id;
+ this.label = label;
+ this.toggle = toggle;
+ this.order = counter.getAndIncrement();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public List getProblemTypes() {
+ return problemTypes;
+ }
+
+ public Toggle getToggle() {
+ return toggle;
+ }
+
+ public static final class Toggle {
+
+ public enum Option {
+ AUTO,
+ OFF,
+ ON
+ }
+
+ private final String label;
+
+ private final EnumSet