This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 209284 - New PHP Code Folding nearly unusable
Summary: New PHP Code Folding nearly unusable
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal with 5 votes (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on: 213107
Blocks:
  Show dependency tree
 
Reported: 2012-03-07 19:32 UTC by wnjordan
Modified: 2012-09-18 02:12 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wnjordan 2012-03-07 19:32:09 UTC
Product Version = NetBeans IDE Dev (Build 201203050400)
Operating System = Linux version 2.6.35-32-generic running on amd64
Java; VM; Vendor = 1.6.0_20
Runtime = OpenJDK 64-Bit Server VM 19.0-b09

The IDE is automatically collapsing all looping structures on a page when it's opened - and- in the options I do not have "Tags and Other Code Blocks" checked.

Also, when I'm working on the code the ide is automatically collapsing code blocks as I work which is so annoying.

Another problem is that the code folding should not effect code that occurs on a single line.
Another bug is that when it does collapse, lets say an if/else statement for example, that's on a single line, you cannot expand it by clicking the plus as only the code after the if is expanded.  The only way to expand the code after the else is to double-click it.

The only way that I've found to be able to work on my scripts is to expand everything when I first open the file and then manually collapse all of the functions.  And, fyi, expand all doesn't always work.

At this point, it would be better for you guys to not include these new code folding features into 7.2 unless your going to spend the time to get them working right.

A few other upgrades to code folding that would make it on par with other IDE's:
1. In the Code Folds menu's add "Collapse/Expand All Function/Methods" & "Collapse/Expand All Comments"
2. Right mouse click options to expand everything a selected code block.
3. Cache the folded state of each file so that it can be restored to it's previous state when it's re-opened.  This would make the "Collapse By Default" options apply to only newly opened files.
4. Stop the IDE from automatically collapsing code while a file is being edited.
Comment 1 Ondrej Brejla 2012-03-09 07:39:20 UTC
Too many things in one issue. There should be one issue for every single problem (some of them are enhancement, some are workning for me, some are won't fix, etc...). At first try to use IDE with a new userdir (clear instal, don't import anything from previous versions).

Autocollapsing -> can't reproduce it (I have collapsed everything, I switch off autocollapsing of methods, tags, etc., reopen the IDE, and everything is expanded)

Collapse when writing code -> I can reproduce...quite annoying behavior

Single line -> enhancement

Double click -> won't fix (there is no other solution in the folding infrastructure -> not PHP module problem)

Expand all: works for me properly

It's in the dev build...and it's there for testing purposes...to let you, our "dev build users", test it and find bugs...and that's exactly what you are doing now, aren't you? We are not able to find all bugs...so you have to help us. And that's why we are releasing dev build...
Comment 2 Ondrej Brejla 2012-03-09 07:55:40 UTC
Just one note to "autocollapsing when editing", it happens in 7.1.1 as well. It's there for a long time...and I'm not sure, that it's a PHP module problem. We are just providing some offset ranges to folding infrastructure (from CSL API modules)...have to investigate it more.

And just to clarify...the behavior with new "folding blocks" is still the same as it was in previous versions (from PHP module point of view), we now just provide more offset blocks, so the "whole folding behavior" is still the same.
Comment 3 schlaefer 2012-06-13 15:12:25 UTC
Autocollapsing: I trigger it all the time in 7.2beta. Even when typing in a block:

http://dl.dropbox.com/u/33642/dump/Screen%20Recording%202.mp4

(Product Version: NetBeans IDE Dev (Build 201206130001))

I'm not sure if do something wrong, but productivity clearly went down with the new code folding feature. Until http://netbeans.org/bugzilla/show_bug.cgi?id=213107 is implemented imho Netbeans shouldn't ship with small code folding activated.

For 2. there's a ticket: http://netbeans.org/bugzilla/show_bug.cgi?id=213218
Comment 4 Ondrej Brejla 2012-06-14 07:17:34 UTC
As you can see...the both issues which affect this one are not caused by PHP modules...it has to be fixed there, I can't do anything with that on my side. Unfortunately. Hopefully they will fix it soon for next release.

And you can simply workaround it by switching autocollapsing off. I know, it's not so "cool" but...you know.
Comment 5 hlupec 2012-07-26 09:45:52 UTC
Hi, php editor is quite unusable because of this issue.

Is there an option, that it will be fixed earlier than in next release? Some 'puncove koule' could be a reward:D
Comment 6 Ondrej Brejla 2012-07-26 12:37:40 UTC
If you mean that annoying autocollapsing when code template is applied (e.g. "fnc"), so it's the same behavior as in Java editor (if I have "Methods" option checked and type "Pm", it's pasted and collapsed)...maybe some great feature? :/

If you mean that issue, where collapsing of cycles, conditions and such is driven by "Methods" option...there is no other option since "Tags and Other Code Blocks" is owned by classes...and why? Because CSL doesn't implement an API for "Inner Classes" option. Just vote for issue #213107. Once it is implemented I can reimplement PHP folding. It's a one-line change. But until that, I think that it's better to have it under "Methods" then "classes...".

But with that "autocollapsing" I can't do anything :( You can file a new issue for Editor/Code Folding and you'll have my vote ;)

And afair this is one of my longes answers in BugZilla, so I think that I deserve that really tasty 'puncove koule', don't I? O:-)
Comment 7 Ondrej Brejla 2012-09-17 08:12:45 UTC
Fixed in web-main #c2024d0d5ea7
Comment 8 Quality Engineering 2012-09-18 02:12:13 UTC
Integrated into 'main-golden', will be available in build *201209180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c2024d0d5ea7
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #209284 - New PHP Code Folding nearly unusable