rust-lang / rust-lang/rust-analyzer

Option for specifying files for buildScripts.rebuildOnSave

Open
#17,749 0 comments 2 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

Currently, rust-analyzer re-runs build scripts when the build script itself is updated.
However, many build scripts depend on other files and use cargo:rerun-if-changed to specify those files to Cargo.
For example, in my project I generate code based on YAML files. However, rust-analyzer won't rerun the build scripts until I save the build script itself or some other source file.

Could rust-analyzer get an option to also specify these files (probably only in local config?), or could rust-analyzer read the rerun-if-changed commands which were passed to Cargo and use those?

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 rust-analyzer's buildScripts.rebuildOnSave handling and how Cargo exposes rerun-if-changed paths. Compare adding local configuration with consuming Cargo's recorded paths; done when changes to declared dependent files trigger the build script rebuild as intended.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.