georgewfraser / java-language-server

Java language server using the Java compiler API
MIT License
642 stars 126 forks source link

Bazel integration does not work with Bzlmod-only workspace. #284

Open evanloriot opened 6 months ago

evanloriot commented 6 months ago

I haven't looked through the source code exactly to tell how bazel dependencies are loaded, but when working from a bazel monorepo that DOES NOT contain a WORKSPACE file (https://bazel.build/external/migration), the extension does not load any jars.

Adding an empty WORKSPACE helped the extension learn that the workspace was a bazel directory and thus started loading the jars. I'm guessing maybe that you'd need to look for EITHER a MODULE / MODULE.bzlmod / etc file or WORKSPACE file to indicate bazel dependency.

Let me know if I can provide more examples / explanation.