rust-lang / rust-lang/rust-analyzer

Update comments that reference refactored symbols

Open
#12,583 0 comments 23 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-ide C-feature
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

In vscode, you can click F2 to rename a module item. In some cases, the module item is referenced with square brackets in one of the comments. For example

// ... some where in your crate
//! This module uses [Builder] to do foo.


// ... else where
struct Builder {
 input_path: PathBuf,
 output_path: PathBuf
}

Later you decide to refactor Builder, for example, by giving it a more special name. You would want the comments that reference the Builder to be refactored, ideally. It would be nice for Rust-Analyzer to locate and update those references and update them when the code is refactored.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the example in VS Code with Rust Analyzer: rename a module item using F2 when it is referenced in a square-bracketed comment. Define done as updating those comment references alongside the symbol rename, including the shown Builder example; the issue names no source files or tests to inspect.

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
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.