rust-lang / rust-lang/rust-analyzer

Quick Fix options for implementing individual default members

Open
#14,189 0 comments 0 reactions 0 assignees View on GitHub

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

Currently there's a quick fix to add implementations for all default members (think trait impl). This is pretty awkward when you only want to add an override for one of them as it will implement all of them (which could be a ton of code) and then you need to figure out which of the ones it added you didn't actually want (i.e. you need to distinguish between three sets: (1) things that were already there, (2) new things that you actually want to change and (3) new things that you want to keep default).

Ideally (I think) the quick fix menu would include one item for each of the default members to add just the implementation of that.

For Intellij (in Java) I would've done this using the "Override methods" action. Here's a clip of that UI: Screenshot 2023-02-21 at 5 43 24 PM

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 locating the quick fix that adds implementations for all default members and trace how its available actions are constructed. Add separate actions for individual default members, then verify that selecting one adds only that implementation while preserving the existing behavior for the all-members action.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.