Skip to content

Add support for enum completions #40091

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

Closed
wants to merge 2 commits into from

Conversation

Kingwl
Copy link
Contributor

@Kingwl Kingwl commented Aug 17, 2020

Fixes #40129

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 17, 2020
@Kingwl Kingwl changed the title Add support for enum completions 【WIP】Add support for enum completions Aug 17, 2020
@DanielRosenwasser
Copy link
Member

@typescript-bot pack-this

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Aug 18, 2020

If I recall correctly, we always prioritize enum declarations in situations like

enum E { A }

function foo(x: E) {
  if (x == /**/)
}

Here, we'll prioritize completions for E. Do you happen to know where that logic lives?

@Kingwl
Copy link
Contributor Author

Kingwl commented Aug 19, 2020

src\services\completions.ts

getRecommendedCompletion I guess.

@Kingwl Kingwl changed the title 【WIP】Add support for enum completions Add support for enum completions Aug 19, 2020
@Kingwl
Copy link
Contributor Author

Kingwl commented Nov 16, 2020

I think this implementation is terrible. Need more investigate and discussion.

Thank you for your review.
Sorry again

@Kingwl Kingwl closed this Nov 16, 2020
@Kingwl Kingwl deleted the case_for_enum_completions branch November 16, 2020 03:31
@typescript-bot
Copy link
Collaborator

The TypeScript team hasn't accepted the linked issue #40129. If you can get it accepted, this PR will have a better chance of being reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Completions: Suggest enum member or literal union Inside switch statement
4 participants