Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4020152
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:11:34+00:00 2026-05-20T10:11:34+00:00

When editing really long code blocks (which should definitely be refactored anyway, but that’s

  • 0

When editing really long code blocks (which should definitely be refactored anyway, but that’s beyond the scope of this question), I often long for the ability to collapse statement blocks like one can collapse function blocks. That is to say, it would be great if the minus icon appeared on the code outline for everything enclosed in braces. It seems to appear for functions, classes, regions, namespaces, usings, but not for conditional or iterative blocks. It would be fantastic if I could collapse things like ifs, switches, foreaches, that kind of thing!

Googling into that a bit, I discovered that apparently C++ outlining in VS allows this but C# outlining in VS does not. I don’t really get why. Even notepad++ will so these collapses if I select the C# formatting, so I don’t get why Visual Studio doesn’t.

Does anyone know of a VS2008 add-in that will enable this behavior? Or some sort of hidden setting for it?

Edited to add: inserting regions is of course an option and it did already occur to me, but quite frankly, I shouldn’t have to wrap things in a region that are already wrapped in braces… if I was going to edit the existing code, I would just refactor it to have better separation of concern anyway. (“wrapping” with new methods instead of regions 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:11:35+00:00Added an answer on May 20, 2026 at 10:11 am

    Starting with Visual Studio 2017, statement collapsing is built-in.

    There are several extensions that perform this task for pre-2017 versions of VS, starting with VS 2010 version:

    • C# outline
    • C# outline
      2012 (@MSDN)
    • C# outline
      2013 (@MSDN)
    • C# outline
      2015 (@MSDN)
    • Visual Basic and C# Outliner

    The last extension supports only VS 2015 and VS 2017, but it’s the most powerful one.
    It supports syntax coloring inside collapsed blocks, it is more fault-tolerant and optimized.

    If the extension doesn’t seem to install after you used a browser to download it, try using the built-in Visual Studio extension manager.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When editing XAML in VS2008 SP1, the editor is really slow. devenv process seems
Regular expressions are great for text editing. But sometimes they aren't quite enough. For
I have an EditTask View for editing the following properties for a Task that
I have a grayscale icon that I'm editing with Photoshop with a transparent background,
I'm aware that Cake HABTM associations are tricky at the best of times, but
Due to restrictions of editing some of my templates I really need your help
I really like the CTRL - W key in Vim insert mode, but I
this is probably really easy, but here goes: My changes to the magento email
While editing an aspx file I found both these opening tags used for seemingly
When editing HTML in emacs, is there a way to automatically pretty-format a blob

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.