Language server hangs on initialize when workspace root has no rescript.json (monorepo)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- node.js
- Área
- devtools
Línea de trabajo
Ejecuta la reproducción proporcionada de Python stdio contra node_modules/@rescript/language-server/out/cli.js con una rootUri para un directorio sin rescript.json y, a continuación, rastrea el manejo de initialize y el descubrimiento del proyecto. Se considera terminado cuando initialize devuelve el control de inmediato para ese workspace, ya sea localizando un proyecto o informando de que el workspace no es compatible o está vacío; verifica que el caso existente con una raíz de proyecto siga respondiendo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
When the editor workspace root is a monorepo root that does not itself contain a rescript.json, the language server never responds to the LSP initialize request — it hangs silently and produces no stderr output. Editors that spawn one server instance per workspace (Zed) are left with a dead server: every request (formatting, hover, completions, code actions) fails until the process is torn down.
Environment
- @rescript/language-server 1.74.0 (also reproduced on 1.72.0)
- macOS 26, Node v24.13.0
- Editor: Zed 1.18 (extension rescript 0.4.4), but this is reproducible standalone over stdio
Repo layout
monorepo/ ← workspace root, no rescript.json here
packages/
my-app/
rescript.json ← the actual ReScript project
src/...
Reproduction
Pipe a framed initialize request to the server over stdio:
python3 - <<'EOF'
import subprocess, json
msg = json.dumps({"jsonrpc":"2.0","id":1,"method":"initialize","params":{
"rootUri":"file:///path/to/monorepo", # no rescript.json at this level
"capabilities":{}}})
payload = f"Content-Length: {len(msg)}\r\n\r\n{msg}"
p = subprocess.Popen(["node","node_modules/@rescript/language-server/out/cli.js","--stdio"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
try:
out, err = p.communicate(payload.encode(), timeout=10)
print("responded:", b'"id":1' in out)
except subprocess.TimeoutExpired:
p.kill(); print("HUNG: no response in 10s")
EOF
Results
| scenario | result |
|---|---|
rootUri = directory containing rescript.json |
responds immediately, documentFormattingProvider: true |
rootUri = monorepo root (no rescript.json at root) |
hangs indefinitely, no stderr |
same, with workspaceFolders including the rescript.json dir |
still hangs |
same, with rootUri at root + cwd at the rescript.json dir |
still hangs |
| both 1.72.0 and 1.74.0 | identical behavior |
Expected behavior
The server should respond to initialize even when the root has no rescript.json — either by locating the nearest project in the workspace, or by reporting an empty/unsupported workspace so the editor can degrade gracefully (or the user can be told to add the project folder).
Actual behavior
Silent hang. In Zed this manifests as: launch → cannot read LSP message headers → teardown → every subsequent request logs rescript-language-server failed: server shut down. Formatting-on-save, hover, and completions are all silently dead. The user sees no error explaining that the workspace root needs to be (or contain) a ReScript project.
Workarounds
- Open the directory containing rescript.json as the workspace root, or
- Bypass the LSP formatter via an external formatter (rescript format --stdin .res) — but semantic features remain dead.
- Lenguaje dominante
- ReScript
- Estrellas
- 354
- Forks
- 63
- Merge medio
- 11 h 29 min
- PR fusionados (30 d)
- 1
Guía de contribución
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 rescript-lang/rescript-vscode
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rescript-lang/rescript-vscode#1185 ·
-
Binary resolution fails on Windows with ERR_INVALID_URL_SCHEME when compiler-info.json is missing Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
rescript-lang/rescript-vscode#1184 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
rescript-lang/rescript-vscode#1186 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
rescript-lang/rescript-vscode#1182 · 1 comentario ·
-
Syntax highlighting of functions Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rescript-lang/rescript-vscode#1175 ·
Todos los issues de rescript-lang/rescript-vscode
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
babalae/bettergi-scripts-list#3674 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
caddyserver/caddy#8046 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
zilliztech/memsearch#759 ·
-
[Bug]: classify_items.py cron script never includes its own required JSON schema in the prompt Abiertocomp/cron P2 sweeper:risk-automation type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#117792 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
bancolombia/sentinel#20 ·