Skip to content

Completions: Suggest enum member or literal union Inside switch statement #40129

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
Kingwl opened this issue Aug 19, 2020 · 1 comment
Open
5 tasks
Assignees
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript

Comments

@Kingwl
Copy link
Contributor

Kingwl commented Aug 19, 2020

Search Terms

suggestions

Examples

enum E {
    A,
    B,
}
declare const e: E
switch (e) {
    case /*1*/
}

Expected:
Suggest E.A, E.B

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.
@RyanCavanaugh RyanCavanaugh added In Discussion Not yet reached consensus Suggestion An idea for TypeScript labels Aug 19, 2020
@RyanCavanaugh RyanCavanaugh added Domain: Completion Lists The issue relates to showing completion lists in an editor Experience Enhancement Noncontroversial enhancements and removed In Discussion Not yet reached consensus labels Feb 2, 2022
@gabritto gabritto self-assigned this Feb 2, 2022
@gabritto
Copy link
Member

This issue might be superseded by #50996. It's not the same functionality, but it might address the underlying need. Let's see.

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 Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants