Preference pages for props and yaml ls editor

Allows configuring problem severities.
The ui works but is not yet wired to transmit
these setting to the language server.
This commit is contained in:
Kris De Volder
2020-10-02 10:22:41 -07:00
parent 0a29c539b5
commit dbe9520f3d
25 changed files with 632 additions and 64 deletions

View File

@@ -30,6 +30,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.springframework.ide.eclipse.boot.core.BootPropertyTester;
import org.springframework.ide.eclipse.boot.validation.BootValidationActivator;
import org.springframework.ide.eclipse.boot.validation.preferences.BootValidationPreferencesPage;
import org.springframework.ide.eclipse.boot.validation.rules.ValidationRuleDefinitions;
import org.springframework.ide.eclipse.editor.support.preferences.EditorType;
import org.springframework.ide.eclipse.editor.support.preferences.PreferencesBasedSeverityProvider;
@@ -111,7 +112,7 @@ public class SpringBootProjectBuilder extends IncrementalProjectBuilder {
}
private IValidationContext validationContext(IResource rsrc, IValidationRule rule) {
SeverityProvider severityProvider = new PreferencesBasedSeverityProvider(rsrc.getProject(), BootValidationActivator.PLUGIN_ID, EditorType.JAVA);
SeverityProvider severityProvider = new PreferencesBasedSeverityProvider(BootValidationPreferencesPage.util, rsrc.getProject(), BootValidationActivator.PLUGIN_ID, EditorType.JAVA);
return (IResource cu, ProblemType problemId, String msg, int offset, int end) -> {
ProblemSeverity severity = severityProvider.getSeverity(problemId);
if (severity==ProblemSeverity.IGNORE) {

View File

@@ -24,13 +24,20 @@ import org.springframework.ide.eclipse.editor.support.reconcile.ProblemType;
*/
public class BootValidationPreferencesPage extends AbstractProblemSeverityPreferencesPage {
public static final ProblemSeverityPreferencesUtil util = new ProblemSeverityPreferencesUtil("boot.project.validation.builder.");
public BootValidationPreferencesPage() {
super(util);
}
protected List<ProblemType> getProblemTypes() {
return BootValidationProblemType.values();
}
@Override
protected String getEnableProjectPreferencesKey() {
return ProblemSeverityPreferencesUtil.ENABLE_PROJECT_PREFERENCES(EditorType.PROP);
return util.ENABLE_PROJECT_PREFERENCES(EditorType.PROP);
}
@Override

View File

@@ -16,7 +16,6 @@ import org.springframework.ide.eclipse.boot.validation.BootValidationActivator;
import org.springframework.ide.eclipse.boot.validation.rules.ValidationRuleDefinitions;
import org.springframework.ide.eclipse.editor.support.preferences.AbstractProblemSeverityPreferencesPage;
import org.springframework.ide.eclipse.editor.support.preferences.EditorType;
import org.springframework.ide.eclipse.editor.support.preferences.ProblemSeverityPreferencesUtil;
import org.springframework.ide.eclipse.editor.support.reconcile.ProblemType;
/**
@@ -24,13 +23,17 @@ import org.springframework.ide.eclipse.editor.support.reconcile.ProblemType;
*/
public class BootValidationProjectPropertyPage extends AbstractProblemSeverityPreferencesPage {
public BootValidationProjectPropertyPage() {
super(BootValidationPreferencesPage.util);
}
protected List<ProblemType> getProblemTypes() {
return ValidationRuleDefinitions.getProblemTypes();
}
@Override
protected String getEnableProjectPreferencesKey() {
return ProblemSeverityPreferencesUtil.ENABLE_PROJECT_PREFERENCES(EditorType.JAVA);
return BootValidationPreferencesPage.util.ENABLE_PROJECT_PREFERENCES(EditorType.JAVA);
}
@Override