rust-lang / rust-lang/rust-analyzer

Automatically add dependencies for other workspace members

Open
#15,758 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Today when working with a multi crate project in a workspace it's quite common that you need to manually add a path reference to Cargo.toml to a sibling crate manually on first use. It would be very nice if rust-analyzer could automatically propose adding a missing dependency to the crate's Cargo.toml as code action under the import name.

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 with a multi-crate workspace where an import refers to a sibling crate without a path dependency, and inspect how rust-analyzer handles code actions for imports. Done means a code action under the import name proposes adding the missing path dependency to the crate's Cargo.toml.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.