rust-lang / rust-lang/rust-analyzer
feat: add assist: extract methods to super trait
Open
Nobody has claimed this yet.
A-assists
C-feature
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Example
trait Foo {
fn foo();
$0fn bar();
fn baz();$0
}
impl Foo for () {
fn foo() { println!("a") }
fn bar() { println!("b") }
fn baz() { println!("c") }
}
->
trait $0SuperTrait {
fn bar();
fn baz();
}
trait Foo: SuperTrait {
fn foo();
}
impl SuperTrait for () {
fn bar() { println!("b") }
fn baz() { println!("c") }
}
impl Foo for () {
fn foo() { println!("a") }
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation file or test is named. Start by locating rust-analyzer's existing assist implementations and tests, then compare the requested example transformation with the current assist structure. Done means the assist extracts the selected methods into a new super trait and updates the original trait and impls as shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100