You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be possible to support bazel with jdtls, just as salesforce/bazel-vscode-java provides jars via contributes.javaExtensions to redhat-developer/vscode-java which get injected into the jdtls initializationOptions.bundles
The salesforce/bazel-vscode-java extension downloads p2-repository.zip which it then extracts, does some renaming and puts them under ~/.vscode/extensions/sfdc.bazel-vscode-java-1.4.0/server. And since salesforce/bazel-vscode-java exports a list of those jars via contributes.javaExtensions in it's package.json those settings are available to other extensions.
Source: salesforce/bazel-vscode-java:gulpfile.js and salesforce/bazel-vscode-java:package.json
When redhat-developer/vscode-java starts the language server it pulls from contributes.javaExtensions and provides those as a bundles array under the initializationOptions when starting jdtls:
Source: redhat-developer/vscode-java:src/extension.ts
I think the Zed Java Extension could potentially add support for Bazel with the following settings:
Totally untested but I wanted to document my research somewhere.
Not sure whether the current Extension APIs are sufficient to support downloading arbitrary zip files, extracting a subset of them and then injecting the correct pathing for where those files are. But assuming this works, we could certainly provide instructions doing this manually.
I'm not a Java programmer.
I have no experience with Bazel.
Would love if someone can see if they can get this working.
This would seem perfectly implementable to me, but unfortunately, as far as I'm aware1, there isn't a way to have an extension modify the initialization options before they're passed to the language server :(
Footnotes
emphasized because I don't know everything and I'd love to be proven wrong! ↩
I think it would be possible to support bazel with jdtls, just as salesforce/bazel-vscode-java provides jars via
contributes.javaExtensions
to redhat-developer/vscode-java which get injected into the jdtlsinitializationOptions.bundles
The
salesforce/bazel-vscode-java
extension downloads p2-repository.zip which it then extracts, does some renaming and puts them under~/.vscode/extensions/sfdc.bazel-vscode-java-1.4.0/server
. And sincesalesforce/bazel-vscode-java
exports a list of those jars viacontributes.javaExtensions
in it'spackage.json
those settings are available to other extensions.Source: salesforce/bazel-vscode-java:gulpfile.js and salesforce/bazel-vscode-java:package.json
When
redhat-developer/vscode-java
starts the language server it pulls fromcontributes.javaExtensions
and provides those as abundles
array under theinitializationOptions
when startingjdtls
:Source: redhat-developer/vscode-java:src/extension.ts
I think the Zed Java Extension could potentially add support for Bazel with the following settings:
Totally untested but I wanted to document my research somewhere.
Not sure whether the current Extension APIs are sufficient to support downloading arbitrary zip files, extracting a subset of them and then injecting the correct pathing for where those files are. But assuming this works, we could certainly provide instructions doing this manually.
I'm not a Java programmer.
I have no experience with Bazel.
Would love if someone can see if they can get this working.
See also:
The text was updated successfully, but these errors were encountered: