This extension hides Rust unit tests from view, including #[test] functions and #[cfg(test)] modules, so you can focus purely on your implementation code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
A VSCode extension that automatically hides Rust unit tests when they're in the same module as business logic code. This helps you focus on your implementation code while keeping tests easily accessible.
Features
Automatically hides Rust test modules marked with #[cfg(test)]
Hides test functions marked with #[test]
Can be toggled on/off through VSCode settings
Enabled by default
Usage
Install the extension
Open any Rust file containing tests
The tests will be automatically folded
To view tests, simply click the fold indicator (▶) next to the test module or function
To disable the extension, go to Settings and uncheck "Silence of the Tests: Enabled"
Configuration
The extension can be configured through VSCode settings:
silenceOfTheTests.enabled: Enable/disable the extension (default: true)
Example
// Business logic
pub fn add(a: i32, b: i32) -> i32 {
a + b
}
// Hidden test module
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_add() {
assert_eq!(add(2, 2), 4);
}
}
Requirements
VSCode 1.85.0 or higher
Rust language support
Extension Settings
This extension contributes the following settings:
silenceOfTheTests.enabled: Enable/disable hiding of Rust unit tests
Known Issues
None at the moment.
Release Notes
0.0.1
Initial release of Silence of the Tests
Following extension guidelines
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.