Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cargo.features a crate-level config #18114

Open
alibektas opened this issue Sep 14, 2024 · 1 comment
Open

Make cargo.features a crate-level config #18114

alibektas opened this issue Sep 14, 2024 · 1 comment
Assignees

Comments

@alibektas
Copy link
Member

alibektas commented Sep 14, 2024

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
creating rust-analyzer.toml in crate 2 and 4's root and adding cargo.features = ["example_feature"] has no effect,
however if i replace it with rust-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 #13529 (comment)

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

@alibektas alibektas self-assigned this Sep 14, 2024
@alibektas
Copy link
Member Author

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,

@vaqxai I cannot reproduce any errors when I use cargo {build,check,metadata} --features example_feature. These are the three subcommands we use in rust-analyzer. Would you mind sharing your whole workspace ( I mean to say a minimal example where the said error is to be seen)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant