intellij
intellij copied to clipboard
IDE Collision, when opening bazel project with different IDE
Description of the bug:
Hello,
When i try to open/import a Bazel project that is already opened by Goland I get the error:
/.../.ijwb already exists
How can I fix this problem?
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Firstly import a Bazel project with Goland then try to import it with Pycharm.
Which Intellij IDE are you using? Please provide the specific version.
Goland 2023.3, Pycharm 2023.3
What programming languages and tools are you using? Please provide specific versions.
Golang 1.21, Python 3.11
What Bazel plugin version are you using?
2024.01.02.0.1-api-version-233
Have you found anything relevant by searching the web?
https://github.com/bazelbuild/intellij/issues/1245
Any other information, logs, or outputs that you want to share?
No response
@kamyab98 Could you please provide sample code to reproduce this issue?
Hi, me and @kamyab98 are experiencing the same issue.
To reproduce the issue, you can simply create an empty folder (the root of your project)
and then add the content of the this file to WORKSPACE.bazel
file in your root.
Then import this empty project using bazel plugin in Goland, sync project files, let it create the .ijwb
folder, and so on.
When the import is complete, close the Goland program.
Now open PyCharm, try to import the same project you created with bazel again. When importing, choose .ijwb/.bazelproject
as your project view.
Now you will get the error
/.../.ijwb already exists
mentioned by @kamyab98
@iancha1992
Hello! Instead of importing the project in the second IDE, could you try just "Open"ing the project? It's a bit counter-intuitive (it has bitten me a few times), but importing just means "Create the project files". Once that's done, you should be able to import it into any JetBrains IDE (except CLion, for reasons)
Please let me know if it works for you!
Hi we tried that as well. When you just open the project, it will definitely open without encountering errors and you'll even be able to code. However, the bazel plugin's sync button won't show up in the ui, resulting in unresolved reference errors all around the code. This happens in both of these scenarios:
- creating bazel project view with goland, then opening it with pycharm.
- creating bazel project view with pycharm, then opening it with goland.
As of now, the workaround we chose is to have two .ijwb folders, one for each IDE. When swtiching IDEs we just rename the correct folder (e.g. .ijwb.pycharm) to .ijwb. And the first time importing the project we'll make sure no .ijwb folder exists in the project files.
However this is really frustrating as we need to switch languages often.
@blorente
Hi, any updates on the issue? @blorente
Thank you for contributing to the IntelliJ repository! This issue has been marked as stale since it has not had any activity in the last 6 months. It will be closed in the next 14 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
@blorente Hi. Are there any updates?
hi @nobletooth for now we recommend to use the plugins
- Intellij with Go plugin + Python plugin
- or GoLand with Python plugin
- etc.