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

Goland Always Shows "Project Not Configured" on reload #6757

Open
bdleitner opened this issue Sep 13, 2024 · 7 comments
Open

Goland Always Shows "Project Not Configured" on reload #6757

bdleitner opened this issue Sep 13, 2024 · 7 comments
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: GoLand GoLand plugin type: bug

Comments

@bdleitner
Copy link

Description of the bug:

TL:DR; Opening a Bazel project from the project dir leads to "project not configured" warnings, and the bazel menu is missing.

Relevant versions:
Goland: 2024.2.1.1
Bazel plugin: 2024.08.27.0.1.-api-version-242
Bazel: 7.3.1 (via Bazelisk 1.19.0)
OS: Windows 10

I'm in the process of moving my Go code projects to bzlmod and I noticed that when I loaded any of them, when I opened the WORKSPACE or newly generated MODULE.bazel file, I'd get a banner warning "Project is not configured"
project_not_configured

Going through the Import Bazel Project quick fix tried to create a new project view .bazelproject file, but since there already is one, I see:
project_view_exists

Wondering if there was some old cruft in the project, I closed the project and deleted the .ijwb, .idea directories and the bazel-* shortcuts, leaving only the code and BULD, MODULE.bazel, and WORKSPACE files.

I then went through the import process again and it worked, giving me the bazel toolbar.

Finally, I closed the project and reopened it, and the original "Project not configured" was back, and an .idea directory in the root (not under .ijwb) was created.

On a whim, I tried closing the project again and this time when I went to open by directory, I saw that the project no longer had the bazel icon, but I tried opening the .ijwb directory instead of the project's root dir and then things worked as expected.

Note that #3759 is still occurring as well, so opening "recent" projects by their .ijwb directories is difficult in the "recent projects view."

I wonder if the two issues are connected.

Which category does this issue belong to?

GoLand

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

  1. In an empty directory, create the following:

WORKSPACE file - empty

MODULE.bazel

bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "gazelle", version = "0.38.0")
  1. Go through the import bazel project wizard, create the .bazelproject from scratch and use the default.
  2. Confirm that the bazel toolbar is available.
  3. Close the project and then repoen it.

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

Goland: 2024.2.1.1

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

No response

What Bazel plugin version are you using?

No response

Have you found anything relevant by searching the web?

No response

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

No response

@bdleitner bdleitner added awaiting-maintainer Awaiting review from Bazel team on issues type: bug labels Sep 13, 2024
@github-actions github-actions bot added product: GoLand GoLand plugin labels Sep 13, 2024
@tpasternak
Copy link
Collaborator

tpasternak commented Sep 13, 2024

@jastice @agluszak PTAL

@tpasternak
Copy link
Collaborator

tpasternak commented Sep 13, 2024

@bdleitner thank you for reaching us. What do you do exactly to reopen the projects (can you share the paths, too?)

@bdleitner
Copy link
Author

When I reopen the project, I just go to File->Open, and browse the folders where my projects are. For example, I have a project called "expressions" at C:\projects\go\expressions and it has an .ijwb subfolder which itself contains an .idea folder and the .bazelproject file.

In the file selection window, the expression folder has the green bazel icon:
expression_folder

If I click that folder (instead of the .ijwb subfolder) to open, then I get the "Project not configured" warning and a new .idea folder is created directly under C:\projects\go\expressions. When I then go to the same File...open path I see this:
expression_folder_2
Where the .idea subfolder now shows up and the icon has changed.

Deleting that top-level .idea folder brings the icon back to bazel, and as long as I only open from the .ijwb directory everything works fine.

Notably, I tried this out with IJ as well (since I just updated to 2024.2.1, and this does not happen there. Projects in IJ opened from the "root" directory rather than .ijwb work as expected.

@tpasternak
Copy link
Collaborator

Thank you for reporting that. So I'm aware of the problem, however I don't have time to fix it right now. Until then, unfortunately you have to choose the .ijwb dir

@tpasternak
Copy link
Collaborator

@bdleitner some good news, @LeFrosch is working on this issue for CLion, maybe we'll be able to handle it for all IDEs

@LeFrosch
Copy link
Collaborator

Hi, when you open the "expressions" directory directly and you get the "not configured" warning is it a false positive? I.e. does everything work in the project like code navigation etc?

@bdleitner
Copy link
Author

Hi, when you open the "expressions" directory directly and you get the "not configured" warning is it a false positive? I.e. does everything work in the project like code navigation etc?

The bazel tooling is not available, so no project sync or anything like that, but code navigation works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: GoLand GoLand plugin type: bug
Projects
None yet
Development

No branches or pull requests

5 participants