Settings for bean injection completion and bean structure

This commit is contained in:
aboyko
2025-02-28 16:12:52 -05:00
parent 9ccbc328ee
commit d4bbdf4f2f
9 changed files with 62 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2024 Pivotal, Inc.
* Copyright (c) 2017, 2025 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
@@ -52,4 +52,8 @@ public class Constants {
public static final String PREF_CRON_INLAY_HINTS = "boot-java.cron.inlay-hints";
public static final String PREF_COMPLETION_JAVA_INJECT_BEAN = "boot-java.java.completions.inject-bean";
public static final String PREF_BEANS_STRUCTURE_TREE = "boot-java.java.beans-structure-tree";
}

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2024 Pivotal, Inc.
* Copyright (c) 2017, 2025 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
@@ -182,8 +182,8 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
Map<String, Object> supportXML = new HashMap<>();
Map<String, Object> bootChangeDetection = new HashMap<>();
Map<String, Object> scanTestJavaSources = new HashMap<>();
Map<String, Object> validation = new HashMap<>();
Map<String, Object> javaValidation = new HashMap<>();
Map<String, Object> javaSettings = new HashMap<>();
Map<String, Object> javaCompletionSettings = new HashMap<>();
IPreferenceStore preferenceStore = BootLanguageServerPlugin.getDefault().getPreferenceStore();
@@ -200,8 +200,11 @@ 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));
validation.put("java", javaValidation);
javaCompletionSettings.put("inject-bean", preferenceStore.getBoolean(Constants.PREF_COMPLETION_JAVA_INJECT_BEAN));
javaSettings.put("beans-structure-tree", preferenceStore.getBoolean(Constants.PREF_BEANS_STRUCTURE_TREE));
javaSettings.put("completions", javaCompletionSettings);
javaSettings.put("reconcilers", preferenceStore.getBoolean(Constants.PREF_JAVA_RECONCILE));
bootJavaObj.put("jpql", preferenceStore.getBoolean(Constants.PREF_JPQL));
bootJavaObj.put("live-information", liveInformation);
@@ -209,7 +212,7 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
bootJavaObj.put("change-detection", bootChangeDetection);
bootJavaObj.put("scan-java-test-sources", scanTestJavaSources);
bootJavaObj.put("change-detection", bootChangeDetection);
bootJavaObj.put("validation", validation);
bootJavaObj.put("java", javaSettings);
bootJavaObj.put("remote-apps", getAllRemoteApps());
bootJavaObj.put("modulith-project-tracking", preferenceStore.getBoolean(Constants.PREF_MODULITH));

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2024 Pivotal, Inc.
* Copyright (c) 2017, 2025 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
@@ -54,6 +54,12 @@ public class BootJavaPreferencesPage extends FieldEditorPreferencePage implement
// Experimental Modulith support
addField(new BooleanFieldEditor(Constants.PREF_MODULITH, "Spring Boot Modulith automatic project tracking and metadata update", fieldEditorParent));
// Experimental Bean Injections completion in Java editor
addField(new BooleanFieldEditor(Constants.PREF_COMPLETION_JAVA_INJECT_BEAN, "Inject Bean completion proposals in Java editor", fieldEditorParent));
// Experimental Beans tree
addField(new BooleanFieldEditor(Constants.PREF_BEANS_STRUCTURE_TREE, "Beans structure tree in the outline view", fieldEditorParent));
Composite c = new Composite(fieldEditorParent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(c);

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2024 Pivotal, Inc.
* Copyright (c) 2017, 2025 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
@@ -69,6 +69,10 @@ public class PrefsInitializer extends AbstractPreferenceInitializer {
preferenceStore.setDefault(Constants.PREF_PROPS_COMPLETIONS_ELIDE_PREFIX, false);
preferenceStore.setDefault(Constants.PREF_CRON_INLAY_HINTS, true);
preferenceStore.setDefault(Constants.PREF_COMPLETION_JAVA_INJECT_BEAN, true);
preferenceStore.setDefault(Constants.PREF_BEANS_STRUCTURE_TREE, false);
}
}