VScode
Rust Analyzer doesn’t directly analyze the code of dependencies that are enabled only by a feature flag. To fix this and enable Rust Analyzer to jump to definitions and provide better support for your sub-module, you can adjust the settings in your Rust project to ensure that the stwo
feature is enabled for the workspace.
The solution is to edit Workspace Settings
- Open Command Palette:
- Press
Ctrl+Shift+P
(orCmd+Shift+P
on macOS). - Type
Preferences: Open Workspace Settings (JSON)
and select it.
- Press
- Add Rust Analyzer Configuration:
- In the
settings.json
file that opens, add the following configuration:
{ "rust-analyzer.cargo.features": ["stwo"] }
If you already have other settings in this file, just add this line under existing ones. - In the
- save and restart rust analyzer.