CodeActions to JDT reconciler. Don't use OR CU cache.
This commit is contained in:
@@ -31,9 +31,9 @@ public class Constants {
|
||||
|
||||
public static final String PREF_CHANGE_DETECTION = "boot-java.change-detection.on";
|
||||
|
||||
public static final String PREF_REWRITE_RECONCILE = "boot-java.rewrite.reconcile";
|
||||
public static final String PREF_JAVA_RECONCILE = "boot-java.java.reconcile";
|
||||
|
||||
public static final String PREF_REWRITE_RECONCILE_PROMPT = "rewrite.reconcile-prompt";
|
||||
public static final String PREF_JAVA_RECONCILE_PROMPT = "java.reconcile-prompt";
|
||||
|
||||
public static final String PREF_REWRITE_RECIPE_FILTERS = "boot-java.rewrite.recipe-filters";
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
|
||||
|
||||
IPreferenceStore preferenceStore = BootLanguageServerPlugin.getDefault().getPreferenceStore();
|
||||
|
||||
if (preferenceStore.getBoolean(Constants.PREF_REWRITE_RECONCILE_PROMPT) && !preferenceStore.getBoolean(Constants.PREF_REWRITE_RECONCILE)) {
|
||||
if (preferenceStore.getBoolean(Constants.PREF_JAVA_RECONCILE_PROMPT) && !preferenceStore.getBoolean(Constants.PREF_JAVA_RECONCILE)) {
|
||||
PlatformUI.getWorkbench().getDisplay().asyncExec(() -> {
|
||||
try {
|
||||
NotificationQuestionWithLink question = new NotificationQuestionWithLink(
|
||||
@@ -187,9 +187,9 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
|
||||
"Do you wish to enable additional Java sources reconciling to get Spring specific validations and suggestions?\n\n" +
|
||||
"See <a>Validations And Quick Fixes</a> for more details.",
|
||||
new URL("https://github.com/spring-projects/sts4/wiki/Validations-And-Quick-Fixes"),
|
||||
() -> preferenceStore.setValue(Constants.PREF_REWRITE_RECONCILE, true),
|
||||
() -> preferenceStore.setValue(Constants.PREF_JAVA_RECONCILE, true),
|
||||
() -> {},
|
||||
() -> preferenceStore.setValue(Constants.PREF_REWRITE_RECONCILE_PROMPT, false));
|
||||
() -> preferenceStore.setValue(Constants.PREF_JAVA_RECONCILE_PROMPT, false));
|
||||
question.setDelayClose(-1);
|
||||
question.open();
|
||||
} catch (Exception e) {
|
||||
@@ -212,6 +212,7 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
|
||||
Map<String, Object> scanTestJavaSources = new HashMap<>();
|
||||
Map<String, Object> validation = new HashMap<>();
|
||||
Map<String, Object> validationSpelExpressions = new HashMap<>();
|
||||
Map<String, Object> javaValidation = new HashMap<>();
|
||||
|
||||
IPreferenceStore preferenceStore = BootLanguageServerPlugin.getDefault().getPreferenceStore();
|
||||
|
||||
@@ -227,8 +228,10 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
|
||||
bootChangeDetection.put("on", preferenceStore.getBoolean(Constants.PREF_CHANGE_DETECTION));
|
||||
scanTestJavaSources.put("on", preferenceStore.getBoolean(Constants.PREF_SCAN_JAVA_TEST_SOURCES));
|
||||
|
||||
javaValidation.put("reconcilers", preferenceStore.getBoolean(Constants.PREF_JAVA_RECONCILE));
|
||||
validationSpelExpressions.put("on", preferenceStore.getBoolean(Constants.PREF_VALIDATION_SPEL_EXPRESSIONS));
|
||||
validation.put("spel", validationSpelExpressions);
|
||||
validation.put("java", javaValidation);
|
||||
|
||||
bootJavaObj.put("live-information", liveInformation);
|
||||
bootJavaObj.put("support-spring-xml-config", supportXML);
|
||||
@@ -239,7 +242,6 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
|
||||
bootJavaObj.put("remote-apps", getAllRemoteApps());
|
||||
|
||||
bootJavaObj.put("rewrite", Map.of(
|
||||
"reconcile", preferenceStore.getBoolean(Constants.PREF_REWRITE_RECONCILE),
|
||||
"recipe-filters", StringListEditor.decode(preferenceStore.getString(Constants.PREF_REWRITE_RECIPE_FILTERS)),
|
||||
"scan-directories", FileListEditor.getValuesFromPreference(preferenceStore.getString(Constants.PREF_REWRITE_RECIPES_SCAN_DIRS)),
|
||||
"scan-files", FileListEditor.getValuesFromPreference(preferenceStore.getString(Constants.PREF_REWRITE_RECIPES_SCAN_FILES))
|
||||
@@ -342,7 +344,7 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
|
||||
this.noHandler = noHandler;
|
||||
this.stopAskingHandler = stopAskingHandler;
|
||||
|
||||
setParentShell(PlatformUI.getWorkbench().getDisplay().getActiveShell());
|
||||
setParentShell(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
|
||||
setBlockOnOpen(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,6 @@ public class RewritePreferencePage extends FieldEditorPreferencePage implements
|
||||
addField(new BooleanFieldEditor(Constants.PREF_REWRITE_PROJECT_REFACTORINGS,
|
||||
"Project refactoring actions", fieldEditorParent));
|
||||
|
||||
addField(new BooleanFieldEditor(Constants.PREF_REWRITE_RECONCILE,
|
||||
"Reconciling of Java Sources", fieldEditorParent));
|
||||
|
||||
addField(new BooleanFieldEditor(Constants.PREF_REWRITE_RECONCILE_PROMPT,
|
||||
"Prompt for Reconciling of Java Sources", fieldEditorParent));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@ public class PrefsInitializer extends AbstractPreferenceInitializer {
|
||||
|
||||
preferenceStore.setDefault(Constants.PREF_SCAN_JAVA_TEST_SOURCES, false);
|
||||
|
||||
preferenceStore.setDefault(Constants.PREF_REWRITE_RECONCILE_PROMPT, true);
|
||||
preferenceStore.setDefault(Constants.PREF_REWRITE_RECONCILE, false);
|
||||
preferenceStore.setDefault(Constants.PREF_JAVA_RECONCILE_PROMPT, true);
|
||||
preferenceStore.setDefault(Constants.PREF_JAVA_RECONCILE, false);
|
||||
preferenceStore.setDefault(Constants.PREF_REWRITE_PROJECT_REFACTORINGS, true);
|
||||
|
||||
preferenceStore.setDefault(Constants.PREF_REWRITE_RECIPE_FILTERS, StringListEditor.encode(new String[] {
|
||||
|
||||
@@ -10,40 +10,30 @@
|
||||
*******************************************************************************/
|
||||
package org.springframework.tooling.boot.ls.prefs;
|
||||
|
||||
import org.eclipse.jface.preference.PreferencePage;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||
import org.springframework.tooling.boot.ls.BootLanguageServerPlugin;
|
||||
import org.springframework.tooling.boot.ls.Constants;
|
||||
|
||||
public class ValidationPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
||||
|
||||
public ValidationPreferencePage() {
|
||||
}
|
||||
|
||||
public ValidationPreferencePage(String title) {
|
||||
super(title);
|
||||
}
|
||||
|
||||
public ValidationPreferencePage(String title, ImageDescriptor image) {
|
||||
super(title, image);
|
||||
}
|
||||
public class ValidationPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||
|
||||
@Override
|
||||
public void init(IWorkbench workbench) {
|
||||
setPreferenceStore(BootLanguageServerPlugin.getDefault().getPreferenceStore());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createContents(Composite parent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createControl(Composite parent) {
|
||||
Composite content = new Composite(parent, SWT.NONE);
|
||||
setControl(content);
|
||||
protected void createFieldEditors() {
|
||||
Composite fieldEditorParent = getFieldEditorParent();
|
||||
|
||||
addField(new BooleanFieldEditor(Constants.PREF_JAVA_RECONCILE,
|
||||
"Reconciling of Java Sources", fieldEditorParent));
|
||||
|
||||
addField(new BooleanFieldEditor(Constants.PREF_JAVA_RECONCILE_PROMPT,
|
||||
"Prompt for Reconciling of Java Sources", fieldEditorParent));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user