Search code examples
sql-serverazure-data-studio

How to Collapse All Regions in Azure Data Studio


I used to use SSMSBOOST in Microsoft SQL Server Management Studio https://www.ssmsboost.com/

where it add "REGIONS" support to the editor, which is very helpful to organize the scripts. But Recently with my switch to user Microsoft Azure Data Studio which is the best alternative (Visual Studio Code Like) editor, I noticed they offer this feature of "Regions" as exactly the same syntax:

--#region
... script here
--#endregion

But the issue is how to collapse all regions in the file; either by some kind of command, or in the opening of the file as this is the default behavior for SSMSBoost add-ins.


Solution

  • By default its ctrl+K then ctrl+0 to fold all.

    Use ctrl+K then ctrl+J to unfold all regions.

    They can be rebound in File ► Preferences ► Keyboard Shortcuts, under 'Fold All', and 'Unfold All'.