rust-lang / rust-lang/rust-analyzer

invoke cargo check with rust-project.json

Open
#16,246 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When I use a bazel generated rust-project.json, cargo check is not invoked by rust-analyzer on save.

When I remove rust-project.json and stick to a handwritten Cargo.toml, cargo check is invoked on save as expected.

Is there a way I can make cargo check work with rust-project.json? I understand the main point of rust-project.json is to avoid depending on Cargo.toml but I miss having the error-on-save development workflow.

Thanks!

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

Reproduce the difference between a Bazel-generated rust-project.json and a handwritten Cargo.toml by saving a Rust file and observing whether rust-analyzer invokes cargo check. Trace how rust-analyzer handles rust-project.json and determine whether error-on-save checking can be supported there; done means cargo check runs on save with that project configuration.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.