Skip to content

Provide editor feature for filling in 'switch' cases for common scenario #35428

@fwd079

Description

@fwd079

Hi,

Not a bug, but a feature request please. Have been asked to post feature request here.

Version Used:
N/A

Steps to Reproduce:

  1. Create an enum.
  2. Create a variable in a method for that enum, assign value.
  3. Type sw(tab)(tab) and press Enter.

Expected Behavior:
Like C#, enum values to be auto-listed as cases.

 let status: StatusETW = etw.EtwStatusId as StatusETW;
            switch (status) {
                case StatusETW.Cancelled:
                    break;
                case StatusETW.Completed:
                    break;
                case StatusETW.Draft:
                    break;
                case StatusETW.EligibleToWork:
                    break;
                case StatusETW.Expired:
                    break;
                case StatusETW.UnComplete:
                    break;
                case StatusETW.Unlock:
                    break;
                default:
                    break;
            }

Actual Behavior:
This happens:

let status: StatusETW = etw.EtwStatusId as StatusETW;
            switch (status) {

                default:
            }

Kind Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions