Bazel Support

未關閉
#27 5 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
12/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
java, rust

研究方向

Start with the linked salesforce/bazel-vscode-java and redhat-developer/vscode-java references to see how the bundles list reaches jdtls through initializationOptions. The open question is whether the Zed extension API can download, extract and locate these jars, which is unresolved in the thread. Done would be either a verified manual setup that loads the Bazel bundles, or a settled answer that the API cannot do this.

由索引模型根據 Issue 內容生成。

描述

help wanted

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:

{
  "lsp": {
    "jdtls": {
      "initialization_options": {
        "bundles": [
          "somepath/org.eclipse.equinox.event.jar",
          "somepath/com.github.ben-manes.caffeine.jar",
          "somepath/org.jsr-305.jar",
          "somepath/org.fusesource.jansi.jar",
          "somepath/com.google.protobuf.jar",
          "somepath/com.salesforce.bazel.importedsource.jar",
          "somepath/com.salesforce.bazel.sdk.jar",
          "somepath/com.salesforce.bazel.eclipse.core.jar",
          "somepath/com.salesforce.bazel.eclipse.jdtls.jar"
        ]
      }
    }
  }
}

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:

主要語言
Rust
星號
225
分支
47
平均合併
3 小時
30 天內合併 PR
5

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

zed-extensions/java 的其他 Issue

查看 zed-extensions/java 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。