rust-lang / rust-lang/rust-analyzer
[VSCode client] Extension appears to be ignoring workspace-level `runBuildScripts` setting
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Repro
- Create or
git clonea Rust project which includes a build script (I'm currently seeing the issue in rust-skia) - (optional) For easier identification of the issue, force a build script to fail by explicitly
panicing - In VSCode > Settings > User tab, ensure the setting Rust-analyzer > Cargo: Run Build Scripts is enabled
- Create a new file in the test workspace at
.vscode/settings.jsonwith the following content:{ "rust-analyzer.cargo.runBuildScripts": false, "rust-analyzer.procMacro.enable": false } - If necessary, run
cargo cleanat the workspace root and re-open VS Code with the RA extension enabled
Actual Behavior
- The
rust-analyzerindicator in the status bar eventually displays a "Warning" icon - View > Output > Rust Analyzer Language Server displays something like the following output:
[ERROR rust_analyzer::reload] failed to switch build data: rust-analyzer failed to run build scripts: ...
Expected
Rust Analyzer extension should respect the workspace-level cargo.runBuildScripts setting and forgo executing build scripts if the option is disabled.
Notes
Please let me know if there's something I'm missing / some other explanation for the behavior I'm seeing.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in a VS Code workspace using the reported Rust project setup, enabling the user setting and disabling rust-analyzer.cargo.runBuildScripts in .vscode/settings.json. Trace how the VS Code client reads workspace configuration and verify that the workspace value is applied; done means build scripts are not executed and the Rust Analyzer output no longer reports their failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100