The "Rust Feature Toggle" is a Visual Studio Code extension designed to enhance the workflow of Rust developers by providing an easy way to toggle feature flags directly from the VSCode interface. Utilizing the status bar and command palette, you can quickly enable or disable features in your Rust project.
Note: You need to install the vsce package globally: npm install -g vsce
Steps
Clone the repository: git clone https://github.com/itsyaasir/rust-feature-toggle.git
Navigate to the extension directory: cd rust-feature-toggle
Install dependencies: yarn
Build the extension: vsce package
Install the extension: code --install-extension rust-feature-toggle-x.x.x.vsix
Reload VSCode
Run the command Rust Feature Toggle in the Command Palette to activate the extension
Features
Toggle features from the status bar: Click on the feature name in the status bar to toggle it on or off
Toggle features from the command palette: Open the command palette (Ctrl+Shift+P) and search for "Rust Feature Toggle" to select and toggle features
Quick pick list of features to toggle: When running the "Rust Feature Toggle" command, a quick pick list of available features is displayed for easy selection
Gutter decorations to indicate feature status: Gutter decorations (icons) are displayed next to feature flags in your Rust code to indicate their current status
Usage
Open a Rust project in Visual Studio Code
The extension will automatically detect feature flags in your Rust code
Click on a feature name in the status bar to toggle it on or off
Alternatively, open the command palette (Ctrl+Shift+P) and search for "Rust Feature Toggle" to select and toggle features
Gutter decorations will update in real-time to reflect the current status of each feature flag
Configuration (To Be Implemented)
The extension provides the following configuration options:
rustFeatureToggle.statusBar: Enable or disable the feature toggle status bar item (default: true)
rustFeatureToggle.gutterDecorations: Enable or disable gutter decorations for feature flags (default: true)
To modify these settings:
Open the Settings editor in Visual Studio Code (File > Preferences > Settings)
Search for "Rust Feature Toggle"
Update the desired configuration options
Contributing
Contributions are welcome! If you encounter any issues, have suggestions for improvements, or would like to add new features, please open an issue or submit a pull request on the GitHub repository.