Skip to content

Add configurable LSP backend support with rust-jdt-ls e2e test runner#1

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/adapt-rust-jdt-ls-project
Draft

Add configurable LSP backend support with rust-jdt-ls e2e test runner#1
Copilot wants to merge 2 commits intomainfrom
copilot/adapt-rust-jdt-ls-project

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 14, 2026

The extension was hardwired to the bundled Eclipse JDT LS with no mechanism to substitute an alternative LSP implementation (e.g. rust-jdt-ls).

New configuration: java.jdt.ls.serverPath

Added to the Startup configuration section (order: 35). Three behaviours:

Value Effect
(empty, default) Bundled Eclipse JDT LS — no change
Directory path Use that directory as the server home (supersedes JDT_LS_PATH)
Executable file path Launch the binary directly via stdio transport (e.g. rust-jdt-ls)

Changing the setting triggers the existing "please reload" prompt.

Server startup changes (src/javaServerStarter.ts)

  • prepareExecutable() — checks java.jdt.ls.serverPath first; delegates to prepareCustomExecutable() when it resolves to a file.
  • New exported prepareCustomExecutable(serverPath, workspacePath, isSyntaxServer) — minimal Executable over stdio; passes --syntax-server in LightWeight/Hybrid mode and workspace via --data.
  • prepareParams() — honours the directory variant when resolving the Eclipse server home.
// rust-jdt-ls binary launched as:
// /path/to/rust-jdt-ls [--syntax-server] --data /path/to/workspace
export function prepareCustomExecutable(serverPath, workspacePath, isSyntaxServer): Executable

E2E test runner for rust-jdt-ls (test/runtest-rust.ts)

Reuses the existing lightweight-mode-suite and standard-mode-suite suites unchanged. Configures java.jdt.ls.serverPath via workspace settings.json before each suite run. Binary path is supplied via the RUST_JDT_LS_PATH environment variable; the runner exits cleanly (code 0) when the variable is unset or the binary is absent so CI without rust-jdt-ls is unaffected.

RUST_JDT_LS_PATH=/path/to/rust-jdt-ls npm run test:rust
Original prompt

适配 git@github.com:ifrankwang/rust-jdt-ls.git 项目,确保:1. 可以通过配置切换实际使用的 lsp;2. 以 rust-jdt-ls 作为 lsp 后端,确保其拥有完整的 e2e 功能测试覆盖(如果可以尽量复用现有 e2e 测试),包括 LightWeight 模式和 Standard 模式(无需确保每个测试都能通过,但需要通过使用 eclipse.jdt.ls 作为 lsp 后端来确保 e2e 测试本身没有问题)

Created from VS Code.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: ifrankwang <18070730+ifrankwang@users.noreply.github.com>
Copilot AI changed the title [WIP] Adapt project for configurable LSP switching and e2e tests Add configurable LSP backend support with rust-jdt-ls e2e test runner Mar 14, 2026
Copilot AI requested a review from ifrankwang March 14, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants