Open
Description
π Search Terms
object literal, error span, squigglies, highlight, decoration, editor, range
β Viability Checklist
- 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, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
β 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:
π» Use Cases
This would make errors clearer and less jarring when defining large objects as function inputs.