Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add a registry flag to disable ExternalWorkspaceDataProvider #6706

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions base/src/META-INF/blaze-base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@
<registryKey defaultValue="false"
description="The Bazel Plugin uses the --target_pattern_file option to pass the targets via a file. By default, the file is deleted immediately after the build execution is finished. Set this flag to true to avoid file deletion"
key="bazel.sync.keep.target.files"/>
<registryKey defaultValue="false"
description="Causes the plugin to read external workspace data, enabling features such as code completion for external targets. This may incur the cost of an additional 'bazel mod' call, which could cause issues with older versions or setups."
key="bazel.read.external.workspace.data"/>
<editorNotificationProvider implementation="com.google.idea.blaze.base.wizard2.BazelNotificationProvider"/>
</extensions>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.google.idea.blaze.base.sync.SyncMode;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.registry.Registry;
import org.jetbrains.annotations.Nullable;

import java.util.List;
Expand Down Expand Up @@ -60,7 +61,7 @@ static Boolean isEnabled(BlazeVersionData blazeVersionData) {
// bg: some blaze workspaces with blaze > MINIMUM_BLAZE_VERSION
// have explicitly disabled this bzlmod support and this causes
// `blaze mod` to fail.
return false /* blazeVersionData.bazelIsAtLeastVersion(MINIMUM_BLAZE_VERSION) */;
return blazeVersionData.bazelIsAtLeastVersion(MINIMUM_BLAZE_VERSION) && Registry.is("bazel.read.external.workspace.data");
}

public ListenableFuture<ExternalWorkspaceData> getExternalWorkspaceData(
Expand Down
Loading