diff --git a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/BazelCoreSharedContstants.java b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/BazelCoreSharedContstants.java
index 29c2572a..b11b918a 100644
--- a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/BazelCoreSharedContstants.java
+++ b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/BazelCoreSharedContstants.java
@@ -26,15 +26,18 @@ public interface BazelCoreSharedContstants {
/** the Bazel classpath container ID */
String CLASSPATH_CONTAINER_ID = "com.salesforce.bazel.eclipse.BAZEL_CONTAINER";
+ /** {@code REPO.bazel} */
+ String FILE_NAME_REPO_BAZEL = "REPO.bazel";
+
+ /** {@code MODULE.bazel} */
+ String FILE_NAME_MODULE_BAZEL = "MODULE.bazel";
+
/** {@code WORKSPACE.bazel} */
String FILE_NAME_WORKSPACE_BAZEL = "WORKSPACE.bazel";
/** {@code WORKSPACE} */
String FILE_NAME_WORKSPACE = "WORKSPACE";
- /** {@code WORKSPACE.bzlmod} */
- String FILE_NAME_WORKSPACE_BZLMOD = "WORKSPACE.bzlmod";
-
/** {@code BUILD.bazel} */
String FILE_NAME_BUILD_BAZEL = "BUILD.bazel";
diff --git a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelWorkspace.java b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelWorkspace.java
index d77c1516..5c23e8a9 100644
--- a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelWorkspace.java
+++ b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelWorkspace.java
@@ -13,11 +13,10 @@
*/
package com.salesforce.bazel.eclipse.core.model;
-import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_BUILD;
-import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_BUILD_BAZEL;
+import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_MODULE_BAZEL;
+import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_REPO_BAZEL;
import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_WORKSPACE;
import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_WORKSPACE_BAZEL;
-import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_WORKSPACE_BZLMOD;
import static com.salesforce.bazel.eclipse.core.model.BazelPackageInfo.queryForTargets;
import static java.lang.String.format;
import static java.nio.file.Files.isDirectory;
@@ -62,8 +61,24 @@ public final class BazelWorkspace extends BazelElement
+ * Workspace boundary files are:
+ * WORKSPACE
or WORKSPACE.bzlmod
- * file in a directory.
+ * List of files defining the boundary of a workspace as defined in Bazel's
+ * workspace_layout.cc
+ *
+ *
+ * MODULE.bazel
REPO.bazel
WORKSPACE.bazel
WORKSPACE
* This method is used by {@link BazelWorkspace#exists()} to determine whether a workspace exists. *
@@ -71,14 +86,11 @@ public final class BazelWorkspace extends BazelElementWORKSPACE.bazel
, WORKSPACE
or
- * WORKSPACE.bzlmod
.
+ * Utility function to check whether a given file name is workspace boundary file name.
+ * + * Workspace boundary files are: + *
MODULE.bazel
REPO.bazel
WORKSPACE.bazel
WORKSPACE
WORKSPACE.bzlmod
, false
otherwise
* @see #findWorkspaceFile(Path)
*/
- public static boolean isWorkspaceFileName(String fileName) {
- for (String packageFile : List.of(FILE_NAME_BUILD_BAZEL, FILE_NAME_BUILD)) {
- if (packageFile.equals(fileName)) {
+ public static boolean isWorkspaceBoundaryFileName(String fileName) {
+ for (String workspaceBoundaryFile : WORKSPACE_BOUNDARY_FILES) {
+ if (workspaceBoundaryFile.equals(fileName)) {
return true;
}
}
diff --git a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/ResourceChangeProcessor.java b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/ResourceChangeProcessor.java
index ddf2c41e..a77aba82 100644
--- a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/ResourceChangeProcessor.java
+++ b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/ResourceChangeProcessor.java
@@ -24,11 +24,8 @@
package com.salesforce.bazel.eclipse.core.model;
import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.BAZEL_NATURE_ID;
-import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_BUILD;
-import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_BUILD_BAZEL;
-import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_WORKSPACE;
-import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_WORKSPACE_BAZEL;
-import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.FILE_NAME_WORKSPACE_BZLMOD;
+import static com.salesforce.bazel.eclipse.core.model.BazelPackage.isBuildFileName;
+import static com.salesforce.bazel.eclipse.core.model.BazelWorkspace.isWorkspaceBoundaryFileName;
import java.util.HashSet;
import java.util.Set;
@@ -44,8 +41,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import com.salesforce.bazel.eclipse.core.classpath.InitializeOrRefreshClasspathJob;
-
/**
* Global change listener for Eclipse Workspaces used by the Bazel model.
*/
@@ -69,13 +64,14 @@ private void checkProjectsAndClasspathChanges(IResourceDelta delta) {
// if we have some, we need to refresh classpaths
// but we do this asynchronously and *only* when the workspace is in auto-build mode
- if ((affectedProjects.size() > 0) && isAutoBuilding()) {
- var classpathJob = new InitializeOrRefreshClasspathJob(
- affectedProjects.toArray(new IProject[affectedProjects.size()]),
- modelManager.getClasspathManager(),
- true /* force refresh */);
- classpathJob.schedule();
- }
+ // TODO: disabled because this behavior is annoying/too disruptive (we need a better thing, potentially delay, configurable, notification only)
+ // if ((affectedProjects.size() > 0) && isAutoBuilding()) {
+ // var classpathJob = new InitializeOrRefreshClasspathJob(
+ // affectedProjects.toArray(new IProject[affectedProjects.size()]),
+ // modelManager.getClasspathManager(),
+ // true /* force refresh */);
+ // classpathJob.schedule();
+ // }
}
private void collectProjectsAffectedByPossibleClasspathChange(IResourceDelta delta,
@@ -127,9 +123,7 @@ private void collectProjectsAffectedByPossibleClasspathChange(IResourceDelta del
/* check BUILD files change */
var file = (IFile) resource;
var fileName = file.getName();
- if (fileName.equals(FILE_NAME_BUILD_BAZEL) || fileName.equals(FILE_NAME_BUILD)
- || fileName.equals(FILE_NAME_WORKSPACE_BAZEL) || fileName.equals(FILE_NAME_WORKSPACE)
- || fileName.equals(FILE_NAME_WORKSPACE_BZLMOD)) {
+ if (isBuildFileName(fileName) || isWorkspaceBoundaryFileName(fileName)) {
affectedProjectsWithClasspathChange.add(file.getProject());
}
var fileExtension = file.getFileExtension();
diff --git a/bundles/com.salesforce.bazel.eclipse.jdtls/src/main/java/com/salesforce/bazel/eclipse/jdtls/managers/BazelBuildSupport.java b/bundles/com.salesforce.bazel.eclipse.jdtls/src/main/java/com/salesforce/bazel/eclipse/jdtls/managers/BazelBuildSupport.java
index 67870979..092326f5 100644
--- a/bundles/com.salesforce.bazel.eclipse.jdtls/src/main/java/com/salesforce/bazel/eclipse/jdtls/managers/BazelBuildSupport.java
+++ b/bundles/com.salesforce.bazel.eclipse.jdtls/src/main/java/com/salesforce/bazel/eclipse/jdtls/managers/BazelBuildSupport.java
@@ -81,12 +81,12 @@ public List