bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://ij.bazel.build/
Apache License 2.0
761 stars 303 forks source link

Sync unmarks existing Source Root directories and Mark the root workspace directory as Source Root #6390

Open yerinu2019 opened 4 months ago

yerinu2019 commented 4 months ago

Description of the bug:

This bug was fixed before and came back with the latest IntelliJ IDEA CE version update

Which category does this issue belong to?

Intellij

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Unmark the root directory (workspace directory) as Source Root if it is marked as Source Root.
  2. Mark any non-root directory as Source Root. The directory icon appears with light blue color
  3. Execute partial sync any target. Sync errors occur "no such package, BUILD not found" even though BUILD file exist.
  4. The Source Root directory set in step two is automatically unmarked. The light blue color disappears from the directory icon
  5. The root directory in step 1 is automatically marked as Source Root.

Which Intellij IDE are you using? Please provide the specific version.

IntelliJ IDEA 2024.1 (Community Edition) 240 built on March 27, 2024

What programming languages and tools are you using? Please provide specific versions.

Java

What Bazel plugin version are you using?

2024.03.26.0.1-api-version-241

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

Updating VCS... Running Bazel info... Command: bazel info --tool_tag=ijwb:IDEA:community --curses=no --color=yes --progress_in_terminal_title=no -- Computing VCS working set... 17:39:38 Initial directory update started 17:39:40 Initial directory update finished 17:39:40 Partial Sync started 17:39:43 Build command finished. Retrieving BEP outputs ... 17:39:43 BEP file '/var/folders/1p/tghgs0d937bfk6tnc3byfh8w0000gn/T/intellij-bep-5b3ea84f-b388-4746-9889-f40e7f6f8387' (35151 bytes) 17:39:43 Parsing BEP outputs... 17:39:43 Handling parsed BEP outputs... 17:39:43 BEP outputs have been processed. 17:39:43 Build shard 05288d0b... finished with build errors. 17:39:43 Partial Sync finished

Command: bazel build --tool_tag=ijwb:IDEA:community --keep_going --build_event_binary_file=/var/folders/1p/tghgs0d937bfk6tnc3byfh8w0000gn/T/intellij-bep-5b3ea84f-b388-4746-9889-f40e7f6f8387 --nobuild_event_binary_file_path_conversion --curses=no --color=yes --progress_in_terminal_title=no --noexperimental_run_validations --aspects=@@intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect "--override_repository=intellij_aspect=/Users/seansong/Library/Application Support/JetBrains/IdeaIC2024.1/plugins/ijwb/aspect" --output_groups=intellij-resolve-java-direct-deps,intellij-resolve-py-direct-deps,intellij-info-generic,intellij-info-java-direct-deps,intellij-info-py-direct-deps -- //main/grpc/hello/server/armeria:armeria_lib Computing main repo mapping: Loading: Loading: 0 packages loaded Analyzing: target //main/grpc/hello/server/armeria:armeria_lib (0 packages loaded, 0 targets configured) Analyzing: target //main/grpc/hello/server/armeria:armeria_lib (0 packages loaded, 0 targets configured) [0 / 1] checking cached actions ERROR: no such package 'grpc/hello/proto': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.

tpasternak commented 3 months ago

Thank you for the report. However, it's unclear if we've ever intentionally supported preserving project structure after sync. I've assigned this issue a priority of P4, but we may reconsider this in the future.