vscode icon indicating copy to clipboard operation
vscode copied to clipboard

[folding] go to region command

Open hansyulian opened this issue 7 years ago • 14 comments

So if we have the ctrl + g to go to line, how about we have a shortcut that will allow us to go to certain region in our code?

hansyulian avatar Sep 14 '18 04:09 hansyulian

@hansyulian What do you mean by region? We have a lot of outline, quick outline, breadcrumbs to help navigate within a file.

alexdima avatar Sep 14 '18 09:09 alexdima

the one enclosing a certain part of code like this:

//#region properties
....
//#endregion

//#region computed

//#endregion

hansyulian avatar Sep 14 '18 13:09 hansyulian

I wonder if these regions should appear perhaps in the outline... What programming language are you using?

alexdima avatar Sep 14 '18 14:09 alexdima

We have a command to close all regions (Fold all regions). No sure how we would do that for a 'certain' region.

aeschli avatar Sep 17 '18 09:09 aeschli

yea well aware of the fold all regions, but wonder would it be feasible if we have a better way to navigate between region? for example a region navigator floating window, or shortcut to go to a certain region

hansyulian avatar Sep 17 '18 09:09 hansyulian

From #51364, I'm in favor of adding built-in support for displaying regions in the outline view

mjbvz avatar Sep 17 '18 23:09 mjbvz

I would also like to see regions in the outline view.

rholland avatar Nov 13 '18 08:11 rholland

I would also like to see regions in the outline view.

Cloov avatar Apr 02 '19 16:04 Cloov

I also want it to apear on VS Code. I really need that of thing. It's make the code easier to navigate!

benyaminl avatar May 02 '19 04:05 benyaminl

I want to be able to sort and go to the symbols in the symbol navigator by region (ctrl P + type @), perhaps by typing "@>" or something like that, and have this support nested regions! 🙏

ghost avatar May 15 '19 21:05 ghost

I want to be able to sort and go to the symbols in the symbol navigator by region (ctrl P + type @), perhaps by typing "@>" or something like that, and have this support nested regions! 🙏

We need more waiting seems like that

benyaminl avatar May 16 '19 07:05 benyaminl

I'd also really like to see this implemented. In the meantime has anyone found an Extension that does this?

adamerose avatar Jun 19 '20 18:06 adamerose

@adamerose There's this from 3 months ago: https://github.com/berabue/vscode-region-viewer It's allegedly only for C# regions, but seems to work for JS as well.

Edit: Just made a pull request for extended language support. Nested regions should also be easy to implement in future in this extension.

swift502 avatar Jul 27 '20 16:07 swift502

Hey everyone, I wanted these features too (a "Go to Region..." command, regions in the Outline, etc) so I built an extension that provides them plus a few others:

Region Helper (GitHub)

It wasn't possible to merge regions directly into the builtin Outline, so this adds a separate "Full Outline" tree view instead.

alythobani avatar Mar 11 '25 20:03 alythobani