rust-lang / rust-lang/rust-analyzer
Make `cargo.features` a crate-level config
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
workspace
|-crate1
|-crate2
|-crate3
|_crate4
crate 2 and 4 have a feature called "example_feature" that i want to enable for RA,
so using a workspace setting is a no go, because RA will complain that crates 1 and 3 don't have this feature
creatingrust-analyzer.tomlin crate 2 and 4's root and addingcargo.features = ["example_feature"]has no effect,
however if i replace it withrust-analyzer.cargo.features = ["example_feature"], RA will complain that this is an invalid key that doesn't exist. So it reads the file but when it reads a correct key it doesn't apply that? I have no machine-wide or workspace or user overrides (using VSC right now but same happens in Vim).
Originally posted by @vaqxai in https://github.com/rust-lang/rust-analyzer/issues/13529#issuecomment-2345668435
What the title indicates is just a way to resolve this issue although making such a change is not wanted. This issue is just to discuss and shed a light on what we can do
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
Start by reproducing the behavior described for crate-level rust-analyzer.toml files in crates 2 and 4, comparing cargo.features with rust-analyzer.cargo.features in VS Code or Vim. Done means determining and documenting a supported way to apply a feature only to selected workspace crates without invalid-key errors or affecting crates that lack the feature.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100