rust-lang / rust-lang/rust-analyzer
Assist: Extract struct from function signature
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
When you select the signature of a function, you should have the ability to extract all or part of the function's parameters to a struct.
fn foo(bar: u32, baz: u32) { ... }
->
struct FooStruct {
bar: u32,
baz: u32,
}
fn foo(FooStruct) { ... }
This is something I would like to work on. Is the something that the rust-analyzer team would be interested in?
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
The issue names no files, tests, or entry points; begin by locating rust-analyzer's assist and refactoring implementation. Use the shown function-to-struct transformation as the target, including extraction of all or part of the parameters, and add or run the relevant assist tests once their location is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100