Expected token errors should display all expected tokens, not just the first #43467
Labels
Effort: Moderate
Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
Experience Enhancement
Noncontroversial enhancements
Help Wanted
You can do this
Milestone
π Version & Regression Information
Pretty sure this has been the behaviour since the rewrite.
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
On the last
)
, "Expected ','."π Expected behavior
On the last
)
, "Expected ',' or ']'."Right now the parser only shows the first error that starts at each location. This is an OK approach, especially when parsing has gone badly wrong, but often the parser will expect multiple tokens. The parser should report all the tokens in one error that were previously issued as multiple Expected_0 errors.
The text was updated successfully, but these errors were encountered: