rust-lang / rust-lang/rust-analyzer
Feature request: refactor support for adding a new argument
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
I have a function that looks like this:
pub fn from_hir_id_and_parts(hir_id: hir::HirId, inner: ItemEnum, cx: &DocContext<'_>) -> Item {
and I want to turn it into this:
pub fn from_hir_id_and_parts(hir_id: hir::HirId, inner: ItemEnum, name: Symbol, cx: &DocContext<'_>) -> Item {
It would be nice to have refactor support that automatically added name as an argument everywhere this function is called. It's ok if the resulting code doesn't compile, it gets me close enough that I get useful compile errors instead of 'wrong number of arguments'.
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
Start by tracing the refactor-support entry points for function signature changes and the call sites of from_hir_id_and_parts. Check how existing refactors update callers and how they report incomplete results. Done means adding the name argument can update every known call site, even when the resulting Rust code still needs compiler-guided fixes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100