Shorten error spans for missing key errors reported on object literals #58062
Labels
Needs Proposal
This issue needs a plan that clarifies the finer details of how it could be implemented.
Suggestion
An idea for TypeScript
π Search Terms
object literal, error span, squigglies, highlight, decoration, editor, range
β Viability Checklist
β Suggestion
When defining an object literal with a missing key, e.g. as a function input, highlight only the first line of the object literal as opposed to the entire node.
π Motivating Example
Current behavior (one parameter with missing key):
Suggested behavior (one parameter with missing key):
Current behavior (two parameters with missing keys):
Suggested behavior(two parameters with missing keys):
Here's a TS playground link with the original source:
https://tsplay.dev/N9a3qN
π» Use Cases
This would make errors clearer and less jarring when defining large objects as function inputs.
The text was updated successfully, but these errors were encountered: