Skip to content

Commit 0037e55

Browse files
authored
enable global search by default in prefs (#261)
1 parent d91d236 commit 0037e55

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

bundles/com.salesforce.bazel.eclipse.core/src/main/java/com/salesforce/bazel/eclipse/preferences/BazelPreferenceKeys.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class BazelPreferenceKeys {
2121

2222
// path the the bazel executable
2323
public static final String BAZEL_PATH_PREF_NAME = "BAZEL_PATH";
24-
{
24+
static {
2525
String defaultExecutablePath = BazelCommandManager.getDefaultBazelExecutablePath();
2626
defaultValues.put(BAZEL_PATH_PREF_NAME, defaultExecutablePath);
2727
}
@@ -31,8 +31,8 @@ public class BazelPreferenceKeys {
3131
// to look for the local cache of downloaded jars.
3232
public static final String GLOBALCLASSPATH_SEARCH_PREF_NAME = "GLOBALCLASSPATH_SEARCH_ENABLED";
3333
public static final String EXTERNAL_JAR_CACHE_PATH_PREF_NAME = "EXTERNAL_JAR_CACHE_PATH";
34-
{
35-
defaultValues.put(GLOBALCLASSPATH_SEARCH_PREF_NAME, "false");
34+
static {
35+
defaultValues.put(GLOBALCLASSPATH_SEARCH_PREF_NAME, "true");
3636
}
3737

3838
// *********************************************************************
@@ -44,7 +44,7 @@ public class BazelPreferenceKeys {
4444
// out this is the case. This flag disables this feature, in case that logic causes problems for some users.
4545
// https://github.com/salesforce/bazel-eclipse/issues/164
4646
public static final String DISABLE_UNRESOLVE_WORKSPACEFILE_SOFTLINK = "DISABLE_UNRESOLVE_WORKSPACEFILE_SOFTLINK";
47-
{
47+
static {
4848
defaultValues.put(DISABLE_UNRESOLVE_WORKSPACEFILE_SOFTLINK, "false");
4949
}
5050

bundles/com.salesforce.bazel.eclipse.core/src/main/java/com/salesforce/bazel/eclipse/preferences/BazelPreferencePage.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2121
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2222
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23-
*
23+
*
2424
* Copyright 2016 The Bazel Authors. All rights reserved.
2525
*
2626
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
@@ -56,7 +56,7 @@ public class BazelPreferencePage extends FieldEditorPreferencePage implements IW
5656
private static class BazelBinaryFieldEditor extends FileFieldEditor {
5757
BazelBinaryFieldEditor(Composite parent) {
5858
super(BazelPreferenceKeys.BAZEL_PATH_PREF_NAME, "Path to the &Bazel binary:", true, VALIDATE_ON_KEY_STROKE,
59-
parent);
59+
parent);
6060
}
6161

6262
@Override
@@ -89,14 +89,14 @@ private static class BazelGlobalClasspathSearchEnabledFieldEditor extends Boolea
8989

9090
public BazelGlobalClasspathSearchEnabledFieldEditor(Composite parent) {
9191
super(BazelPreferenceKeys.GLOBALCLASSPATH_SEARCH_PREF_NAME,
92-
"Enable &global classpath search? (experimental)", SEPARATE_LABEL, parent);
92+
"Enable &global classpath search?", SEPARATE_LABEL, parent);
9393
}
9494
}
9595

9696
private static class BazelExternalDownloadCachePathEditor extends DirectoryFieldEditor {
9797
BazelExternalDownloadCachePathEditor(Composite parent) {
9898
super(BazelPreferenceKeys.EXTERNAL_JAR_CACHE_PATH_PREF_NAME,
99-
"Optional: path to the local &cache of downloaded jar files:", parent);
99+
"Optional: path to the local &cache of downloaded jar files:", parent);
100100
}
101101

102102
@Override
@@ -129,6 +129,7 @@ public BazelPreferencePage() {
129129
super(GRID);
130130
}
131131

132+
@Override
132133
public void createFieldEditors() {
133134
addField(new BazelBinaryFieldEditor(getFieldEditorParent()));
134135
addField(new BazelGlobalClasspathSearchEnabledFieldEditor(getFieldEditorParent()));

docs/using_the_feature_classpath.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ You may then manually configure the JDK by configuring the Build Path of any Ecl
5252

5353
### Global Search Classpath
5454

55-
Currently, this is an experimental feature.
56-
See [Global Search Classpath](https://github.com/salesforce/bazel-eclipse/issues/161) issue for status.
57-
5855
This feature provides a benefit when working with large Bazel workspaces.
5956
With a large workspace, during import you will likely only choose to import a handful of packages.
6057
BEF will configure an Eclipse project for each of those packages, with the proper classpath.
@@ -69,12 +66,13 @@ It scans the external jar directory of the Bazel build, and adds all found jars
6966
nested under the Bazel Workspace project in the Package Explorer.
7067
By having them appear in a classpath object, JDT can now find all enclosed types.
7168

72-
To enable this feature do the following *before* importing packages into your workspace:
69+
To disable this feature do the following *before* importing packages into your workspace:
7370
- *Eclipse -> Preferences -> Bazel* (exact menu varies by platform)
74-
- Click the *Enable global classpath search* option.
71+
- Uncheck the *Enable global classpath search* option.
7572

7673
Note that the feature may not work for all use cases.
77-
Check the Issue linked above for details.
74+
See the [Global Search Classpath](https://github.com/salesforce/bazel-eclipse/issues/161) issue for status
75+
and open issues.
7876

7977
### Next Topic: Launching binaries and tests from Eclipse
8078

0 commit comments

Comments
 (0)