Implement Collapsable Regions
Developing a script of some size becomes very tedious when going back and forth, and the script quickly becomes unwieldy.
Add collapsable regions driven by specially formatted comment (--#Region [name/description/comment] ... --#EndRegion, or some other suitable notation).
We’ve had a look at this feature and found a potential existing solution using
BEGIN END blocks in SSMS 2016+
e.g.
BEGIN —this is a “region”
SELECT * FROM TEST;END
We’re not planning to do this in the near future because of the effort required to support all versions of VS and SSMS that Prompt is available on.
Kind Regards,
Prompt Team
-
Anonymous commented
This is a very desirable feature, reconsider adding it for serious coders.
-
Михаил П commented
Due to some changes to alternative (free) products, this feature is highly desirable in SQL Prompt now again.
P.S. IntelliSense overloads and deadlocks, which is why it is prohibited in our organization
-
Denis Valeev commented
SSMS: Tools -> Options -> Text Editor -> Transact-SQL -> IntelliSense -> Outline Statements (check) + enable IntelliSense
-
Denis Valeev commented
> because of the effort required to support all versions of VS
No, just support the latest SSMS. And implement the feature with minimum resources on the begin-end statements as you pointed out. Just start implementing it and see if it goes well. Don't try to embrace every corner case, that's unproductive. -
joehanna commented
PLEASE RECONSIDER.
The problem with using BEGIN/END is it also affects the behaviour of the script in terms of Error handling and exit points. We just need to collapse the code visibly, not affect the flow of the script in the meantime.
-
Andreas Kaudel commented
Yes, this is a very important feature.
Maybe it just exist ? -
Morgan Yarbrough commented
Yes please. I have already implemented this in the ACE editor using the following syntax:
start:
--#region [optional description]
/*#region [optional description]*/end:
--#endregion [optional description]
/*#endregion [optional description]*/Try it out by going to https://ace.c9.io/build/kitchen-sink.html and selecting 'SQLServer' document in top left corner dropdown.
-
John Hennesey commented
I too would love to see collapsible regions include with SqlPrompt; I have used SSMS toolpak, and SSMS Boost - but the only thing I use in them now that isn't included in SqlPrompt is the regions. I don't care to have additional plugins installed for one measly feature. :)
It would be really cool if you could include this feature.
-
Andre Light commented
If you happen to have Visual Studio, you can use SQL Server Data Tools to sync your DB project to VS. It already has Collapsible Regions (and SQL Intellisense, though not as good as SQL Prompt...yet), just like with the other programming languages.
-
Scott Smith commented
Same suggestion as this one:
Let's move this one vote over to that one shall we?
-
Thanks for the suggestion. The SSMS Tools Pack has regions, which you could try. http://www.ssmstoolspack.com/Features?f=10