镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Autofill object literal in IDE #40700

Description

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.

Activity

  1. DanielRosenwasser commented on Sep 22, 2020

    @DanielRosenwasser
    Member

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

  2. mjbvz commented on Sep 22, 2020

    @mjbvz

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: LS: Completion ListsThe issue relates to showing completion lists in an editorIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions