Reputation: 1267
I'm developing a Rust crate where GPU-dependent and GPU-independent parts are separated using features. By default, the GPU-related features are turned off, which leads to a poor development experience in GPU environments as rust-analyzer doesn't function correctly. I use nvim.
I'm looking for a method that meets the following requirements:
Specifically, I'm considering methods such as:
Ideally, I'd like a mechanism where appropriate features are automatically set when entering the project directory, and rust-analyzer recognizes them.
If there are effective methods or best practices to achieve this, please let me know. I'm particularly interested in solutions that consider both rust-analyzer configuration and Cargo configuration.
For context, in my project, when I'm in a GPU environment, I want to enable GPU features for better IDE support, but I don't want to change the default in Cargo.toml as it should remain GPU-optional for users.
Any insights or suggestions would be greatly appreciated!
Upvotes: 0
Views: 61