Skip to content

Autofill object literal in IDE #40700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 tasks done
TheColorRed opened this issue Sep 22, 2020 · 2 comments
Open
5 tasks done

Autofill object literal in IDE #40700

TheColorRed opened this issue Sep 22, 2020 · 2 comments
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@TheColorRed
Copy link

TheColorRed commented Sep 22, 2020

Search Terms

  • autofill object literal

Suggestion

It would be nice if there was a way to automatically fill in the required values of an object literal so I don't have to do it one property at a time, it would set the value to a minimum value (string '', number 0, etc). Then I can manually add the optional properties and there values.

image

Use Cases

This will help speed up creation of objects that have lots of required items.

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.
@DanielRosenwasser DanielRosenwasser added Domain: Completion Lists The issue relates to showing completion lists in an editor In Discussion Not yet reached consensus Suggestion An idea for TypeScript labels Sep 22, 2020
@DanielRosenwasser
Copy link
Member

There's another issue just like this one, but I can't find it. That said, we should discuss this with @mjbvz and @minestarks at some point.

@mjbvz
Copy link
Contributor

mjbvz commented Sep 22, 2020

I have a long standing meta issue about "snippet" style completions: #25207

My original use case was for method signatures and react components, but this idea may be an additional use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants