nrf-rs / nrf-hal

A Rust HAL for the nRF family of devices
Apache License 2.0
503 stars 139 forks source link

Tidies up the configuration to better support VS Code #338

Closed huntc closed 3 years ago

huntc commented 3 years ago

This configuration update reflects the strategy taken with Embassy where a Cargo.example.toml is provided. This example is expected to be updated by the developer and customised for the target they are interested in. Without these changes, working with nrf-hal is quite unpleasant in Visual Studio Code.

A Cargo.ci.toml is provided and used by CI. This file is the original Cargo.toml.

Thanks to @Dirbaio for the recommendations.

jonas-schievink commented 3 years ago

bors r+

bors[bot] commented 3 years ago

Build succeeded:

jonas-schievink commented 3 years ago

Hmm, this still doesn't make rust-analyzer work properly with the provided example file. It seems to think that the 51, 52810, 52811, 52832, 52833, 52840 and 9160 features are all enabled at the same time.

huntc commented 3 years ago

Hmm, this still doesn't make rust-analyzer work properly with the provided example file. It seems to think that the 51, 52810, 52811, 52832, 52833, 52840 and 9160 features are all enabled at the same time.

I shall investigate.

huntc commented 3 years ago

Hmm, this still doesn't make rust-analyzer work properly with the provided example file. It seems to think that the 51, 52810, 52811, 52832, 52833, 52840 and 9160 features are all enabled at the same time.

If I take the Cargo.example.toml as Cargo.toml then open nvmc.rs from common, I see this:

image

i.e. the correct highlighting was given that I'm just bringing in the 52840 feature. Do you see something similar?

If so then how are you observing that all features are enabled?

jonas-schievink commented 3 years ago

Ah, found the issue, I had rust-analyzer.cargo.allFeatures enabled globally, will add that to our VS Code configuration.