intellij icon indicating copy to clipboard operation
intellij copied to clipboard

IDE Collision, when opening bazel project with different IDE

Open kamyab98 opened this issue 1 year ago • 5 comments

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 avatar Jan 23 '24 15:01 kamyab98

@kamyab98 Could you please provide sample code to reproduce this issue?

iancha1992 avatar Jan 23 '24 22:01 iancha1992

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

nobletooth avatar Jan 24 '24 10:01 nobletooth

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!

blorente avatar Jan 31 '24 13:01 blorente

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:

  1. creating bazel project view with goland, then opening it with pycharm.
  2. 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

nobletooth avatar Feb 01 '24 08:02 nobletooth

Hi, any updates on the issue? @blorente

nobletooth avatar Feb 11 '24 12:02 nobletooth

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.

github-actions[bot] avatar Aug 13 '24 02:08 github-actions[bot]

@blorente Hi. Are there any updates?

nobletooth avatar Aug 19 '24 11:08 nobletooth

hi @nobletooth for now we recommend to use the plugins

  • Intellij with Go plugin + Python plugin
  • or GoLand with Python plugin
  • etc.

tpasternak avatar Aug 19 '24 11:08 tpasternak