-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Supporting Cargo Features #1822
Comments
Forgive asking this -- we have the ability to make something a |
It’s won’t be completely wrong to say that rust-analyzer ignores features completely at the moment. There are only two small places where we honor features:
|
@matklad 2 is a good temporary substitute, but since it's done extension wide, it's not very useful. Work and hobby project have different features. Even worse, we don't get an error. Instead, for example, I get this in cargo-watch trace:
So I think a simple |
You can configure the extension settings for each (Code) workspace with the "Open Workspace Settings" command. |
Fair dues for me right now, but I don't think that will work for other |
I'm checking in on this old issue. I think this might be solved now:
Is there anything that's still missing today? |
Yeah, I think it makes sense to close this! One thing we might want to do, though, is to automatically propagate settings from |
Thank you all! I should have remembered to close, but those new features have made this excellent for me |
Follow-up: is it possible to configure this on a per-crate basis when working in a cargo workspace? We're running into the problem where we only want certain features enabled by default (so allFeatures is no good) but those features only apply to one of the several crates in the workspace. It's causing errors when trying to build just other crates. |
Does |
Just tried it, no luck. |
Same issue here, is there an issue for enabling features per-crate within a workspace? |
#10298 has been opened for that |
I did not find the setting |
|
Hello!
I have been using gfx_hal (a common crate if doing graphics work in Rust), and make great use of Cargo conditional compilation features.
The Rust analyzer is great, but has no support for them unless I set a default. I can't git ignore my cargo.toml, so I'm forced to constantly have to revert this change on each computer I use, or commit meaningless changes.
Thanks so much for all the hard work! any help would be great :)
The text was updated successfully, but these errors were encountered: