microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.45k stars 1.53k forks source link

Automatically fold inactive regions #8992

Open sapphyrus opened 2 years ago

sapphyrus commented 2 years ago

Type: Feature Request

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.

sean-mcmanus commented 2 years ago

I don't believe there are VS Code APIs to implement this yet, see https://github.com/microsoft/vscode/issues/40338 . @Colengms might know more.

github-actions[bot] commented 2 years ago

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[bot] commented 1 year ago

This feature request has received enough votes to be added to our backlog.

mrx23dot commented 10 months ago

This would be so useful! Eclipse does it too. The hard part is already done, inactive branches are marked:

image

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

longfeiss commented 1 month ago

vote for this Feature Request