From d407faba3e52e32a929aa9581f4412f474b01a96 Mon Sep 17 00:00:00 2001
From: Dmytro Kashyn <50216138+dkashyn-sfdc@users.noreply.github.com>
Date: Fri, 20 Dec 2024 10:04:39 -0500
Subject: [PATCH] Allow to boost `.ijwb` over BSP and .idea folder. (#7201)
* Allow to boost `.ijwb` over BSP and .idea folder.
* Smarter default in case BSP not installed
* Google plugin has no priority by default and used if JetBrains Bazel is not installed. If BSP is there then registry key value is used.
fixes #7200
---
base/src/META-INF/blaze-base.xml | 5 ++++-
.../blaze/base/project/AutoImportProjectOpenProcessor.java | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/base/src/META-INF/blaze-base.xml b/base/src/META-INF/blaze-base.xml
index f186817d8f7..55f26730761 100644
--- a/base/src/META-INF/blaze-base.xml
+++ b/base/src/META-INF/blaze-base.xml
@@ -412,6 +412,9 @@
+
@@ -422,7 +425,7 @@
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"/>
diff --git a/base/src/com/google/idea/blaze/base/project/AutoImportProjectOpenProcessor.java b/base/src/com/google/idea/blaze/base/project/AutoImportProjectOpenProcessor.java
index 9a85eb31f15..285445f1854 100644
--- a/base/src/com/google/idea/blaze/base/project/AutoImportProjectOpenProcessor.java
+++ b/base/src/com/google/idea/blaze/base/project/AutoImportProjectOpenProcessor.java
@@ -21,7 +21,9 @@
import com.intellij.ide.SaveAndSyncHandler;
import com.intellij.ide.impl.OpenProjectTask;
import com.intellij.ide.impl.ProjectUtil;
+import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.extensions.PluginId;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.project.ex.ProjectManagerEx;
@@ -78,7 +80,8 @@ public Icon getIcon() {
@Override
public boolean isStrongProjectInfoHolder() {
- return false;
+ return !PluginManagerCore.isPluginInstalled(PluginId.getId("org.jetbrains.bazel")) ||
+ Registry.is("bazel.project.prefer.google.plugin");
}
@Override