diff --git a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelTargetInfo.java b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelTargetInfo.java index 79dc4a80..68c7d596 100644 --- a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelTargetInfo.java +++ b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelTargetInfo.java @@ -51,7 +51,8 @@ IProject findProject() throws CoreException { // we don't care about the actual project name - we look for the property var projects = getEclipseWorkspaceRoot().getProjects(); for (IProject project : projects) { - if (project.hasNature(BAZEL_NATURE_ID) // is a Bazel project + if (project.isAccessible() // is open + && project.hasNature(BAZEL_NATURE_ID) // is a Bazel project && !workspaceProject.equals(project) // is not the workspace project && hasWorkspaceRootPropertySetToLocation(project, workspaceRoot) // belongs to the workspace root && hasOwnerPropertySetForLabel(project, getBazelTarget().getLabel()) // represents the target