-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Domain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Description
Search Terms
error call chain fluent api
Suggestion
In call chains some errors like TS2554 ("Expected x arguments, but got y") are reported for the whole call chain.
Example:
In this case the error is reported (starting) at line 5 where the actual error is in line 14.
Suggestion: Just highlight the concerned (last) method invocation in this case.
Use Cases
- Fluent APIs: These sub-optimal error reporting is misguiding in fluent APIs because the start line number can be off hundreds of lines. Further, way too much is highlighted in red squiggles (for a single missing argument as in the example above).
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
zpdDG4gta8XKpMCd, amitbeck and chenshaw1995
Metadata
Metadata
Assignees
Labels
Domain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
