Complete array elements next to a spread from the element type
Why
Since #8905 an array literal with a spread is a Pexp_spread node, and expression completion had no case for it, so an element position next to a spread got no items and a partly typed element fell back to untyped completion.
modifiedCompletion array literal with a spread
type kind = First | Secondlet base: array<kind> = [First]let ys: array<kind> = [...base, ]
text
Before
After
no completion items at the cursor after the comma Completable: Cexpression array<Type[kind]>->arrayFirst, Second
Review
- Why do list literals with a spread still get untyped completion? Completion extracts no element type for a list, so a list literal without a spread gets no typed completion either; the list case stays as before.