rust-lang / rust-lang/rust-analyzer
Feature Request: Commands to toggle feature(s)
Open
@ShoyuVanilla is already working on this.
Since Nov 4, 2025.
A-vscode
C-feature
E-hard
fun
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
It would be nice if you could run a command to toggle specific features by automatically editing the rust-analyzer.cargo.features setting. For instance, the commands could be like:
- "Enable all features": This would set the
rust-analyzer.cargo.featuressetting to"all". - "Enable feature...": This would cause a text box to appear where you could write the feature. That would then be added to the feature list in the
rust-analyzer.cargo.featuressetting. - "Disable all features": Would simply clear the setting.
- "Disable feature...": Should ideally show the list of features already present in the setting and allow you to choose one to disable.
You could also imagine that a code action could be added to #[cfg(feature = "...")] attributes which would enable/disable the feature.
The server should then restart automatically after running this command (which is required whenever editing the setting).
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.
Assessment
This issue has not been assessed yet.