Skip to content
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

Assist idea: extract enum variant to struct #4468

Closed
lnicola opened this issue May 15, 2020 · 5 comments
Closed

Assist idea: extract enum variant to struct #4468

lnicola opened this issue May 15, 2020 · 5 comments
Labels
E-has-instructions Issue has some instructions and pointers to code to get started E-medium

Comments

@lnicola
Copy link
Member

lnicola commented May 15, 2020

(and back)

@matklad
Copy link
Member

matklad commented May 15, 2020

Yup, we should totally steal this from IntelliJ :D

@mcrakhman
Copy link
Contributor

I will look into that :-)

@mcrakhman
Copy link
Contributor

Created a PR for that: #4576

@matklad
Copy link
Member

matklad commented Jun 29, 2020

Status: this works for tuple variants, but is still not implemented for record variants.

Current code is here: https://github.com/rust-analyzer/rust-analyzer/blob/ca31b1d63ae91a69f1ce9c0b075403834ba19f38/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs

@matklad matklad added E-has-instructions Issue has some instructions and pointers to code to get started E-medium labels Jun 29, 2020
bors bot added a commit that referenced this issue Nov 4, 2020
6456: Support record variants in extract_struct_from_enum_variant r=matklad a=Veykril

As requested :)

This also prevents the assist from being disabled if a definition in the value namespace exists with the same name as our new struct since that won't cause a collision

#4468

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
@pksunkara
Copy link
Contributor

I think this can be closed, right?

@lnicola lnicola closed this as completed Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-has-instructions Issue has some instructions and pointers to code to get started E-medium
Projects
None yet
Development

No branches or pull requests

4 participants