You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The extension currently supports dimming inactive regions (#if, #ifdef, ...). Folding these regions is also already supported correctly.
I would like to suggest a feature that combines both of these to automatically fold inactive regions, as a command and on opening a file.
This is a duplicate of #5020, which was (perhaps incorrectly) marked as a duplicate of #407, which is now closed.
Reacted by r4klatif, Marcos Otani, Rozanov, Anatoliy, Phil, Adam Byrd, Abdallah Mansour, Zs0Zs0, Nicholas Maritato, erikjuvan, Mathieu Moreau and 11 more
Reacted by r4klatif, Abdallah Mansour, Zs0Zs0, erikjuvan and ANYZichong
This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.
One issue I found was:
when opening a file at exact location via CMD pallet,
e.g. usb_app.c:162
it jumps to that line, but it jumps away to fold inactive #ifs, and stays there.
only happens if file was not in focus.
Also it happens every time, even if it was folded already.
Activity
sean-mcmanus commentedon Mar 8, 2022
I don't believe there are VS Code APIs to implement this yet, see microsoft/vscode#40338 . Colen Garoutte-Carson (@Colengms) might know more.
github-actions commentedon May 8, 2022
This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.
github-actions commentedon Oct 21, 2022
This feature request has received enough votes to be added to our backlog.
mrx23dot commentedon Nov 16, 2023
This would be so useful! Eclipse does it too.
The hard part is already done, inactive branches are marked:
when opening a file we just need to go through branches and see which one is marked as inactive.
The logic how to do the folding (on multiline comments) is done in this repo:
https://github.com/ietxaniz/vscode-fold-ninja
le1smo commentedon Jul 19, 2024
vote for this Feature Request
l1006986533 commentedon Jun 23, 2025
85c086b
just an demo implementation, no switch yet (always triggers folding on first time opening). Feedback welcome :)
sean-mcmanus commentedon Oct 7, 2026
Phil (@sapphyrus) Mathieu Moreau (@mrx23dot) l1006986533 Lessmore (@le1smo) Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.35.3
mrx23dot commentedon Oct 10, 2026
One issue I found was:
when opening a file at exact location via CMD pallet,
e.g. usb_app.c:162
it jumps to that line, but it jumps away to fold inactive #ifs, and stays there.
only happens if file was not in focus.
Also it happens every time, even if it was folded already.