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

Support generic parameters in "extract function" refactoring #2187

Closed
Tracked by #2183
Undin opened this issue Jan 10, 2018 · 2 comments
Closed
Tracked by #2183

Support generic parameters in "extract function" refactoring #2187

Undin opened this issue Jan 10, 2018 · 2 comments
Labels
E-medium Issue required decent knowledge about platform and project codebase help wanted improvement subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc. subsystem::refactoring Issues related to refactorings

Comments

@Undin
Copy link
Member

Undin commented Jan 10, 2018

Current "extract function" implementation doesn't add type parameters and their bounds for generic arguments into function signature.
It would be great to support it.

fn foo<T: Default>() -> T {
    <selection>T::default()</selection>
}

Expected:

fn foo<T: Default>() -> T {
    bar()
}

fn bar<T: Default>() -> T {
    T::default()
}

Actual:

fn foo<T: Default>() -> T {
    bar()
}

fn bar() -> T {
    T::default()
}
@Undin Undin added help wanted E-medium Issue required decent knowledge about platform and project codebase subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc. improvement labels Jan 10, 2018
@Undin Undin mentioned this issue Jan 10, 2018
20 tasks
@t-kameyama
Copy link
Contributor

I will work on this issue.

bors bot added a commit that referenced this issue Feb 10, 2018
2197: TYPE: Support generic parameters in "extract function" refactoring r=Undin a=t-kameyama

Fix for #2187
@Undin
Copy link
Member Author

Undin commented Feb 13, 2018

Implemented in #2197

@Undin Undin closed this as completed Feb 13, 2018
@artemmukhin artemmukhin added the subsystem::refactoring Issues related to refactorings label Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-medium Issue required decent knowledge about platform and project codebase help wanted improvement subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc. subsystem::refactoring Issues related to refactorings
Projects
None yet
Development

No branches or pull requests

3 participants