fix bazel: prefer .bazelbsp/.bazelproject and fix import/jdeps issues#391
Open
tboernerapex wants to merge 3 commits intoJetBrains:261from
Open
fix bazel: prefer .bazelbsp/.bazelproject and fix import/jdeps issues#391tboernerapex wants to merge 3 commits intoJetBrains:261from
tboernerapex wants to merge 3 commits intoJetBrains:261from
Conversation
…roject view path When a project is reopened after clicking the load bazel project balloon, a previously persisted projectViewPath (e.g. root.bazelproject from a prior session with a different project identity) caused RegenerateProjectViewFileContentPreSyncHook to return early without switching to .bazelbsp/.bazelproject. Fix by checking if .bazelbsp/.bazelproject exists when the early-return condition fires and overriding the persisted path if it differs. Also add calculateExistingBazelbspProjectViewFile to ProjectViewFileUtils so that an existing .bazelbsp/.bazelproject is preferred over arbitrary root-level .bazelproject files in the selection priority chain. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…arsing On first open of a monorepo, imported .bazelproject files may not be in IntelliJ's in-memory VFS cache yet. resolveFromRootOrRelative() only searches that cache, so unresolved imports silently fell back to the whole workspace. preRefreshImports() reads import/try_import paths from raw file text and calls refreshAndFindVirtualFile() to force-load them before the PSI read action. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When two java_test targets in the same BUILD package share the same
basename (e.g. TypesTest), declare_file("materialized_TypesTest.jdeps")
would place both outputs in the package root, causing a conflicting
actions error. Using sibling=raw_jdeps_file places each materialized
file next to its source, which is unique per target subdirectory.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.bazelproject, override it to use.bazelbsp/.bazelprojectif the latter exists — ensuring the plugin-managed file always takes precedence on sync.bazelprojectfiles into IntelliJ's VFS before PSI parsing so thatimportdirectives resolve correctly on first open of a large monorepo (without this, the import silently fails and the sync falls back to the entire workspace)java_testtargets in the same BUILD package share the same basename: usesibling = raw_jdeps_fileindeclare_fileso each materialized.jdepsfile lands next to its source rather than colliding in the package rootTest plan
.bazelbsp/.bazelprojectthat imports a package-level.bazelproject; verify sync only indexes the directories listed in the import chain, not the whole workspacejava_testtargets sharing the same simple name in the same package no longer fails with a conflicting actions error during BSP sync.bazelbsp/.bazelprojecton next sync🤖 Generated with Claude Code