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

Allow to boost .ijwb over BSP and .idea folder. #7201

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
5 changes: 4 additions & 1 deletion base/src/META-INF/blaze-base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@
<registryKey defaultValue="true"
description="By default Bazel plugin takes control and opens project if .ijwb folder is present. This property can be used to disable this behavior to allow to open .idea or other project models if they are exists."
key="bazel.project.auto.open.if.present"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just reuse this one and set it false by default?

Copy link
Contributor Author

@dkashyn-sfdc dkashyn-sfdc Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

present is mutually exclusive of auto-import since there is no need to import then, so no

<registryKey defaultValue="false"
description="Google plugin is not exclusive anymore, and we need to give a chance to BSP to chime in. Otherwise neither will import the project if .idea folder is present. This property can be used to give a priority to .ijwb or alike over .idea *and* BSP."
key="bazel.project.prefer.google.plugin"/>
<registryKey defaultValue="false"
description="The Bazel Plugin sometimes uses the --query_file option to pass the query via a file. By default, the file is deleted immediately after the query execution is finished. Set this flag to true to avoid file deletion"
key="bazel.sync.keep.query.files"/>
Expand All @@ -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"/>
<registryKey defaultValue="true"
description="Enable basic syntax highliting in Query Sync's 'Analysis Disabled' mode"
description="Enable basic syntax highlighting in Query Sync's 'Analysis Disabled' mode"
key="bazel.qsync.enable.basic.highlighting.in.non.analysis.mode"/>
<editorNotificationProvider implementation="com.google.idea.blaze.base.wizard2.BazelNotificationProvider"/>
</extensions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Loading