Improved Code Folding

Hi all! Today we would like to introduce you a new NetBeans 7.2 feature which was very discussed in our BugZilla and had a lot of votes. It was an issue about Code Folding of other PHP structures then just classes, methods and comments.

It wasn't implemented in PHP Editor, because Java Editor didn't support that either. But you, our users, forced us to implement that for you. So now, here it is!

Now you can use code folding for if, else, elseif, do, while, for, foreach, switch, case, try and catch.

Improved Code Folding

That's all for today and as usual, please test it and if you find something strange, don't hesitate to file a new issue (component php, subcomponent Editor). Thanks.

Comments:

GREAT!
Will be a nice boost for us who were getting irritated with the buggy old one :P

//Wasseem

Posted by guest on February 28, 2012 at 07:30 PM CET #

Hi

This is great & I find it very useful in PHP. I wonder wheather it is possible to add the same in C++ module too.

Regards,

Mathew

Posted by Mathew on February 29, 2012 at 11:48 PM CET #

Nice Feature.
I've updated Netbeans Dev 7.2 (20100302) using the buildin updater.
While the other newer Features (like the PHP-Buildin webserver support) are avaible afterwards, the new code folding is not.

Posted by guest on March 02, 2012 at 03:03 PM CET #

Yippppie!

Posted by nikosch on March 13, 2012 at 04:39 PM CET #

Hi,

Can I know how we can add the same feature in C++ module?
Currently it is the most importantly missing feature.

Any help to add this into C++ wil be much appreciated.

Mathew

Posted by guest on March 17, 2012 at 01:24 PM CET #

Hi,

you should ask C++ team to implement it. Use their bugzilla - http://netbeans.org/bugzilla/enter_bug.cgi?product=cnd

Posted by Ondrej Brejla on March 19, 2012 at 09:39 AM CET #

Hi.

Is it possible to deactivate this or to recursively open all subfolds?

I don't want to open nine folds when working on single method, and I also don't want to open all folds in a file.

"Tags and Other Code Blocks" is not checked in Prefs->Editor->General, only "Methods".

Posted by Schlaefer on May 29, 2012 at 10:56 PM CEST #

Hi Schlaefer:
>> Is it possible to deactivate this or to recursively open all subfolds?

You can use just "right click in editor -> Code Folds -> ..." or "View -> Code Folds -> ..." for some global handling of folds.

>> "Tags and Other Code Blocks" is not checked in Prefs->Editor->General, only "Methods".

Yes, because all "control structures" are binded to "Method" option. "Tags and Other Code Blocks" is used for folding of classes :( I have already file a bug against CSL infrastructure (http://netbeans.org/bugzilla/show_bug.cgi?id=213107) (which manages folding for PHP, JS, HTML, etc.) to allow us to use the "Inner Class" option for classes, so then "Tags and Other Code Blocks" can be free for folding of "control structures".

Posted by Ondrej Brejla on May 30, 2012 at 09:21 AM CEST #

Hi Ondrej.

» You can use just "right click in editor -> Code Folds -> ..." or "View -> Code Folds -> ..." for some global handling of folds.

With this new folding behavior Netbeans imho needs a command for recursive folding. Vim for example provides (http://vimdoc.sourceforge.net/htmldoc/fold.html ):

1. open fold under cursor (zo)
2. open folds under cursor recursively (zO)
3. open all folds (zR)

Netbeans currently offers only 1. and 3.

» I have already file a bug against CSL infrastructure

Thanks. Voted, hope that helps. :)

Posted by Schlaefer on May 30, 2012 at 09:45 AM CEST #

>> With this new folding behavior Netbeans imho needs a command for recursive folding.

You can file an enhancement for Editor/Code Folding - http://netbeans.org/bugzilla/enter_bug.cgi?product=editor :)

Posted by Ondrej Brejla on May 30, 2012 at 09:48 AM CEST #

» You can file an enhancement for Editor/Code Folding

Done: http://netbeans.org/bugzilla/show_bug.cgi?id=213218

Posted by Schlaefer on May 30, 2012 at 10:12 AM CEST #

Works like a charm!
Thank you!

Posted by guest on July 09, 2012 at 07:30 PM CEST #

Hi,

I dont need this "if, else, elseif, do, while, for, foreach, switch, case, try and catch." Code Folding. I do not like it. Please give us a setting possibility to switch this new "if, else etc." Code Folding on or off (in global Settings please).

best regards
max (from Germany)

Posted by guest on July 31, 2012 at 03:11 PM CEST #

Hi, it is handled by "Methods" option in Tools->Options->Editor->Code Folding. It can't have its own option in the current implementation. Please vote for this issue http://netbeans.org/bugzilla/show_bug.cgi?id=213107 to force the implementation so we can handle "methods" and "other tags" (if, else, etc.) separately. Thanks.

Posted by Ondrej Brejla on July 31, 2012 at 03:18 PM CEST #

I just upgraded to newest Netbeans and this 'feature' annoys hell out of me, it is just completely wrong, please fix it by either separating 'methods' and control structures or just removing it.

Posted by flamasta on August 05, 2012 at 11:24 PM CEST #

I have to concur with the negative outcry. I need the ability to fold functions and methods but NOT anything inside them. Having to click open 20 folds (or make a mess with "Expand All") is just maddening. One step forward, two steps back...

Please give us more granular control over folds in PHP!

Posted by PHP Coder on August 22, 2012 at 06:59 PM CEST #

Hi flamasta,

as I wrote in the previous comment, vote for issue http://netbeans.org/bugzilla/show_bug.cgi?id=213107

Thanks for your response!

Posted by Ondrej Brejla on August 23, 2012 at 09:23 AM CEST #

I voted, hopefully this will be fixed in the next release. I have to keep code folding off or I waste huge amounts of time unfolding things. I also like the idea of folding methods but not all structures within.

Posted by Blintzbug on August 31, 2012 at 02:34 PM CEST #

Hi there,

I was use to code folding the way it was :)
Is there any way to have only methode folding and not all of the if, while, switch... as an option ?

Dede

Posted by Dede on October 07, 2012 at 03:38 PM CEST #

Dede: it is fixed for 7.3.

Posted by Ondrej Brejla on October 08, 2012 at 09:40 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today