rust-lang / rust-lang/rust-analyzer

Support tools other than Cargo for `rust-analyzer.check.overrideCommand`

Open
#18,460 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I would like to use Rust Analyzer to show hints in my editor of choice.

I know that I can override the command used to feed data to Rust Analyzer.

{
  "rust-analyzer.check.overrideCommand": [
    "cargo",
    "check",
    "--message-format=json"
  ]
}

The problem is that I am working in a Bazel repository where there is no Cargo. The command that comes close is

bazel build --output_groups=+clippy_checks //...

but it produces no JSON output.

I have created a minimal example in https://github.com/otiv-willem-vanhulle/bazel-rust-check

The bazel rules_rust project https://github.com/bazelbuild/rules_rust does not offer a solution either.

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 tracing how the rust-analyzer.check.overrideCommand setting is handled and how command output is converted into diagnostics. Use the linked minimal Bazel example to determine the required non-Cargo output and integration behavior. Done means a supported tool other than Cargo can provide the diagnostics needed for editor hints.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.