Completion offers nothing for an array element after a spread
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- ocaml
- Ambito
- devtools
Direzione di ricerca
The bug is in traverse_expr in analysis/src/completion_expressions.ml, which handles Pexp_array and dict literals but has no case for the Pexp_spread node. Start by reading the Pexp_array branch to see how element positions are traversed, then add handling so an array spread keeps the expected element type. Done when completion after [...base, ] offers First and Second, matching [First, ], and the untyped File module fallback no longer appears.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Found by differential semantic drift analysis from b123b7c3 to c10223e8.
What is broken
type kind = First | Second
let base: array<kind> = [First]
let ys: array<kind> = [First, ]
// ^com First, Second
let ys2: array<kind> = [...base, ]
// ^com nothing
At c10223e8, completion at the second position returns no items; at b123b7c3 it returned a single bogus [] item of type 'a (from Primitive_array.spread). [...base, Fi] falls back to untyped completion (offering First and the module File). The expected items are the same as for [First, ].
traverse_expr handles Pexp_array and dict literals, including dict spreads, but has no case for the Pexp_spread node that #8905 introduced for array and list literals with spreads.
Possible cause (speculation only)
Before #8905 a spread literal was a call to Primitive_array.spread, which completion treated as a function argument; the new node falls into the default case.
🤖 Generated with Claude Code
- Lingua principale
- OCaml
- Stelle
- 7.5k
- Fork
- 484
- Merge medio
- 17h 2m
- PR unite (30g)
- 249
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rescript-lang/rescript
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
rescript-lang/rescript#9182 ·
I maintainer di solito rispondono entro 1 giorno
-
Issues from differential semantic drift analysis (b123b7c3 to c10223e8)Forse già presa @cknitt l’ha presa oggi. Aperta
rescript-lang/rescript#9186 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
rescript-lang/rescript#9185 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
rescript-lang/rescript#9184 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rescript-lang/rescript#9181 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rescript-lang/rescript
Issue simili
-
check-relative-paths reports links to existing directories as missingForse già presa @reidbaker-agent l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/skills_lint.dart#202 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue help wanted
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
-
Phone app shows Unknown for a remote machine whose key changedForse già presa @janicduplessis l’ha presa oggi. Apertaarea: mobile priority: P3 type: bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
appandflow/stim#5006 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
irahardianto/pi-mcp-extension#253 ·
I maintainer di solito rispondono entro 1 giorno
-
A-linter
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
oxc-project/oxc#28783 ·
I maintainer di solito rispondono entro 1 giorno