#Get lint for optional features?
16 messages · Page 1 of 1 (latest)
I’d recommend configuring RA to always run Cargo with --all-features
code is inactive due to #[cfg] directives: target_arch = "wasm32" is disabled
its on, and it still shows that
oh right. well that’s platform-specific stuff. you can set rust-analyzer.cargo.target = "wasm32-unknown-unknown"
don’t think you can check multiple platform simultaneously
how do people debug libraries that have multiple cfg flags then? 🥲
change the target depending on what they’re working on
I was updating a library and I only realized it broke on wasm after I locally ran CLI for the project...
it should be easy to do that
thinking about this more though. rust-analyzer already struggles with large project. I see why it wouldn't be supported.
I recommend having a script that runs checks/tests for all the targets you care about
it's possible to convince RA to build a library for multiple targets, though
hm?
you can use rust-analyzer.linkedProjects to have it check multiple workspaces/packages, and if one of them has a config file specifying a different target and a path dep on the code in the other workspace, then it will run checks for both targets on the same code
however, this of course takes twice as long, and you get duplicated diagnostics.