bazelbuild / intellij

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

Importing an existing repository shows no relevant files #6423

Open jfirebaugh opened 2 months ago

jfirebaugh commented 2 months ago

Description of the issue. Please be specific.

I tried to open https://github.com/aspect-build/aspect-cli. The project doesn't show any of the files in this repository.

What's the simplest set of steps to reproduce this issue? Please provide an example project, if possible.

  1. Clone https://github.com/aspect-build/aspect-cli.
  2. File -> Open...
  3. Select the aspect-cli directory

Expected result: Project view shows all of the files in the directory.

Actual result: Project view shows only the .ijwb directory, nothing else.

Version information

IdeaUltimate: 2024.1 Platform: Mac OS X 14.4.1 Bazel for IntelliJ plugin: 2024.03.26.0.1-api-version-241 Bazel: 7.0.2

tpasternak commented 2 months ago

@jfirebaugh When you import the project with the "Open" button, by default you end up with an empty import. Please edit the projectview file and sync.

jfirebaugh commented 2 months ago

That's a pretty confusing behavior... I think the average user, like me, is just going to think the plugin is broken. Could the default be to include everything, instead of excluding everything? Or could the "Open" button just use the default IntelliJ behavior for generating a project?

tpasternak commented 2 months ago

Excluding everything is a safer option. Many Bazel projects are so large that it's not even possible to import them in their entirety. Moreover, importing an empty project happens instantly, allowing users to immediately start populating the project view file after opening. I recommend:

  1. Using the wizard (File -> Import Bazel Project).
  2. Committing the default project view file to this exact path in your repository: tools/intellij/.managed.bazelproject.

We are also open to suggestions on how to make this process more explicit and user-friendly.