Bazel Support

Aperta
#27 5 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
12/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
java, rust

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

Lingua principale
Rust
Stelle
225
Fork
47
Merge medio
3h
PR unite (30g)
5

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di zed-extensions/java

Tutte le issue di zed-extensions/java

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.