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.
Hello When opening a PHP file with Code Folding enabled, by default everything is folded into one line. That does not make much sense. When opening the first fold even complete classes are folded although the configuration says that only methods inside a class should be folded seperately. My settings in Tools -> Options -> General -> Code Folding are: Use Code Folding: [x] Collapse by Default: [x] Methods [ ] Tags and Other Code Blocks [ ] Inner Classes [ ] Imports [ ] Javadoc Comments [ ] Initial comments bye, -christian-
I can confirm the same issue. Product Version: NetBeans IDE 6.8 (Build 200912041610)
I've just installed NetBeans IDE Dev (Build 201002220200) on Linux and confirm this issue hasn't yet gone away. All fold levels are initially folded.
It's actually more weird than that. Yes, initially all folds are closed, but there are many if blocks for example that do not ~offer~ folding. Many do, but many don't. Maybe it's something picked up in my application code over time? Is there a cache or history that needs flushing? It appears code folding is fundamentally broken and perhaps it's time for a basic design rethink? There are many reports of folding issues and many make sense. Is there a way for all these to be aggregated into a plan to go forward rather than nibbling round the edges?
-> csl
Lots of issues here and forum topics for folding, but this title matches my feeling the best. Even if the item where the entire file collapses is fixed, there is still way to much folding in 6.8. The folding changes in 6.8 have caused me to go back to 6.7 for now. If you are going to add more folding than what we used to have, I would like to see checkbox options for us to select what we want folded. Not what we want folded by default, but folded at all. I've read all the arguments from the people who wanted if blocks and similar items folded, but it causes tremendous frustration for me because I'm not one to have 1000 line if/else blocks. The only thing I want folding for are methods and functions. I know that is an opinion, but that's why I think option boxes to control folding would be best. Since Netbeans supports so many languages, I don't know if that's better in the General tab or under PHP directly. Our enterprise is 100% php now and I've almost convinced everyone to use Netbeans, but I can only recommend 6.7 for our coding standards because of this problem.
PHP editor adds a 'method' fold for <? ?> blocks. If method folds are collapsed by default then opening a .php file will result with all its content folded. I don't see what's wrong in CSL.
*** Bug 180690 has been marked as a duplicate of this bug. ***
Integrated into 'main-golden', will be available in build *201003250201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/51669fc2f64e User: Radek Matous <rmatous@netbeans.org> Log: #179462 - Code folding folds too much
fixed
verified in Product Version: NetBeans IDE Dev (Build 100412-72e08cda4754) @reporters: verify your test cases works as expected, please. Don't hesitate to reopen this bug if not. Build with available changeset: http://bertram.netbeans.org/hudson/job/PHP-Build/? thanks.
I've just tried NetBeans IDE Dev (Build 2010-04-15_15-04-32 ) and found no difference to the behaviour of my original report. When code folding is enabled with only "[x] methods" checked and I open a .php file containing <?php // comment class { function f() {
(sorry for the unfinished comment above :)) I've just tried NetBeans IDE Dev (Build 2010-04-15_15-04-32 ) and found no difference to the behaviour of my original report. When code folding is enabled with only "[x] methods" checked and I open a test.php file containing the following snippet I get the following result: * the outmost "<?php ..." is not folded i.e. "comment 1" visible -> OK (it's sane) * the "class C" is folded -> ORIGINAL BUG! * the "function f" is folded -> OK (desired according to checkbox) <?php // comment 1 class C { // comment 2 function f() { // comment 3 } } So what exactly has been fixed? In the PHP-build Changes on Hudson I find no reference to this bug number. I reopen this one, feel free to correct me if I'm wrong.
http://hg.netbeans.org/web-main/rev/fe6886c219ad Fixed somehow(class declaration block is treated as "Tag or other code blocks"). If you don't like the fix, then reopen and I will consider reverting the fix. Please be aware that the dialog that you use for tweaking collapse/expand default behavior makes little sense for php. The dialog is implemented for java language not php, so there is no direct mapping between options in dialog and php code blocks, so to achieve proper behavior there is need to have own setting dialog for individual languages and also internally better contract between GsfFoldManager and StrctureScanner implemented for individual languages. If you feel still unsatisfied with current behavior, then please reopen but then makes sense to change the issue type as ENHANCEMENT and not DEFECT(definitely not defect in php).
Integrated into 'main-golden', will be available in build *201004220200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/fe6886c219ad User: Radek Matous <rmatous@netbeans.org> Log: #179462 - Code folding folds too much