Note: Be sure to install:
- Bazelisk (instead of Bazel directly)
- IntelliJ with Kotlin and Scala Plugins
Bazel Plugin is useful for highlighting BUILD, WORKSPACE and .bzl files, but the project doesn't import well with it. It will force import the project using its own model instead of Bazel-BSP. Follow the steps below to avoid this.
- Ensure you have Bazel Plugin installed in your IntelliJ
- Go to
Registry...
- Set
bazel.auto.import.disabled
to True. - Close project in IntelliJ.
- If old project was created, you need to delete
.ijwb
directory (most safe solution is to usegit clean -dfx
)
If you do not have Bazel Plugin or followed the instruction above, follow these steps:
- Run setup-bsp.sh script
- Open this project in IntelliJ
- Select all
./bazel-*
directories and mark them as excluded. Otherwise, they will pollute search scope and other features.