-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
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.
josher8a
Metadata
Metadata
Assignees
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript