[Feature] 后端启动的语言服务器也能声明一键安装器和工具最低版本(Java 插件改用用户自装 JDT LS 后的契约缺口)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- java, rust, typescript
- Área
- developer-experience, tooling
Línea de trabajo
Start with the Core plugin contract and the backend launch response decoding that currently accepts {kind: "tool", tool}; then trace where commandInstallers are limited to systemCommand. The issue describes two contract changes and Java plugin adoption, with related references in backend/src/jdtls.rs and backend/src/launch.rs. Done means the contract README, schema, fixture, and protocol update record are updated, and Java can use installer offers and a JDK 21 minimum.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem to solve / 要解决的问题
Java Support 3.0.0 不再随包附带 Eclipse JDT LS 和 JDK(包从约 250 MiB 降到约 11 MiB),改为使用用户自己安装的 JDT LS,和 Go 插件用用户自己的 gopls 一样。但两者在“缺工具时一键安装”上的体验不一致:
- Go 插件的语言服务器是
launch.kind: "systemCommand",可以声明commandInstallers(go install golang.org/x/tools/gopls@latest),用户缺gopls时宿主给出安装按钮。 - Java 插件必须用
launch.kind: "backend"(java.resolveLaunch):JDT LS 的命令行要按安装目录里的org.eclipse.equinox.launcher_*.jar、config_<平台>现算,还要拼 Lombok agent、扩展 bundle、工作区数据目录和设置,systemCommand表达不了。而 Core 当前只把commandInstallers用于systemCommand启动,后端启动答复缺少命令时,插件只能返回launch.server_missing错误加文字说明(brew install jdtls等),用户得自己去终端安装。
另一个相关缺口:后端答复 executable: {kind: "tool", tool: "jdtls-runtime"} 时不能声明最低版本。JDT LS 需要 JDK 21+,插件目前靠 requiresTools 收到的 tools["jdtls-runtime"].version 自己判断并返回 launch.runtime_too_old;宿主的工具选择和发现结果并不知道这个下限,自动选择也不会跳过低版本。
影响:所有 Java 用户升级到 3.0.0 后首次打开 Java 文件,如果没装 JDT LS,只能看到错误提示,需要离开 IDE 手动安装。
Proposed solution / 建议方案
在 Rust Core 插件契约里补两项能力(具体形状由 Core 设计决定):
- 后端启动也能用安装器:允许后端启动的语言服务器在 manifest 里声明
commandInstallers(或在启动函数的错误答复里引用一个已声明的安装器 id),宿主收到对应的pluginErrorCode(如launch.server_missing)时提供安装按钮,装完重试resolveLaunch。Java 插件可以据此提供brew install jdtls(macOS/Linuxbrew)、scoop install jdtls(Windows)等安装方式。 - 后端答复的工具可执行文件可声明最低版本:
{kind: "tool", tool: "jdtls-runtime", minimumVersion: "21"},或在 manifest 的工具定义上声明下限,让宿主自动选择时跳过低版本 JDK,并在工具链设置里标出不满足的安装。
改契约时按 CLAUDE.md 在同一个 Core PR 里更新契约 README、schema、fixture 和协议更新记录,再升级 Java 插件使用新能力。
Target platform / 目标平台
Cross-platform / 跨平台
Area / 模块
Extensions / 扩展
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
- 继续随包附带 JDT LS 和 JDK:就是 2.x 的做法,每个平台包约 250 MiB,这正是要解决的问题。
- 插件运行时自己下载 JDT LS:违反插件规则(不得运行时下载,已安装插件包只读),也绕过了宿主的安装授权流程。
- 把 Java 改成
systemCommand启动:命令行依赖安装目录里带版本号的 launcher JAR 和平台配置目录,还要写入每次启动的 Equinox 配置副本,静态命令表达不了。
当前 3.0.0 的做法:找不到 JDT LS 时返回 launch.server_missing,错误信息写明安装方式和设置入口;JDK 低于 21 时返回 launch.runtime_too_old。
Additional context / 补充信息
- Java 插件 PR:Lithe-IDEA/lithe-plugin-java 的
feat/user-jdtls(3.0.0)。查找顺序、错误码见backend/src/jdtls.rs、backend/src/launch.rs。 - Go 插件的对照做法:Lithe-IDEA/lithe-plugin-go 的
plugin.json(systemCommand+commandInstallers)。 - Core 现状:后端启动答复的解码只接受
{kind: "tool", tool},没有版本字段;commandInstallers只在systemCommand启动路径使用。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.8k
- Forks
- 151
- Merge medio
- 3 h 48 min
- PR fusionados (30 d)
- 571
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de 1lck/Lithe-IDEA
-
review: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
1lck/Lithe-IDEA#2432 ·
Los mantenedores suelen responder en 1 día
-
review: medium
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
1lck/Lithe-IDEA#2431 ·
Los mantenedores suelen responder en 1 día
-
refactor review: high
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
1lck/Lithe-IDEA#2376 ·
Los mantenedores suelen responder en 1 día
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
1lck/Lithe-IDEA#2365 ·
Los mantenedores suelen responder en 1 día
-
review: medium
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
1lck/Lithe-IDEA#2434 ·
Los mantenedores suelen responder en 1 día
Todos los issues de 1lck/Lithe-IDEA
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
posit-dev/positron-sas-extension#196 ·
Los mantenedores suelen responder en 1 día
-
bug composer
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
inmanta/web-console#8037 ·
Los mantenedores suelen responder en 1 día
-
Add: AlFajer Palestine FHDAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
bug: v5 dist/types/components.d.ts imports @stencil/core/runtime instead of ./stencil-public-runtimeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día