Hides inactive code regions including #ifdef, #else, and preprocessor directives, making code easier to read even in files with many conditional compilation blocks.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
A Visual Studio Code extension that hides inactive code regions including #ifdef, #else, and preprocessor directives in C/C++ files, making code easier to read even in files with many conditional compilation blocks.
Note: This extension supports only the clangd extension. It does not support the Microsoft C/C++ extension (ms-vscode.cpptools).
Features
Hide Inactive Code Regions: Automatically hides code regions that are disabled by preprocessor directives based on your current build configuration
Customizable Opacity: Control how hidden regions appear (from completely invisible to fully visible)
Status Bar Control: Convenient status bar button to quickly toggle visibility
Persistent Toggle State: Your toggle preference is automatically saved and restored for each workspace
This extension is particularly useful when working with codebases that heavily use conditional compilation with #ifdef, #ifndef, #if, #else, #elif, and #endif directives.