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 196653

Summary: Editor does not show code folding for php blocks in PHP Web Pages
Product: php Reporter: maghiel <maghiel>
Component: CodeAssignee: Petr Pisl <ppisl>
Status: RESOLVED WORKSFORME    
Severity: normal CC: mmirilovic, pjiricka, vriha
Priority: P3 Keywords: RANDOM
Version: 7.0   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: folding

Description maghiel 2011-03-14 02:07:49 UTC
[ BUILD # : 201103120000 ]
[ JDK VERSION : 1.6.23 ]

Editor does not show code folding for php blocks in PHP Web Pages. 
Only /* */ style comments seem to show the folding options.

    Verify code fold tooltip.
        Collapse a code fold.
        Move mouse cursor onto {...} folding symbols. 
        EXPECTED RESULT: Full content of folded code should appear as a
tooltip. 

*FAIL*

Folding only appears for the HTML. 


---


    PHP functions code folding.
        Add a PHP code with function definition to the page.
        Collapse a code fold with this function.
        Expand that code fold back. 
        EXPECTED RESULT: The code fold should exist and work properly. The
function title should be displayed outside of code fold. 

*FAIL* No code folding! 

-----


    PHP /**/ comments code folding.
        Add a PHP code with /**/ style comment to the page.
        Collapse a code fold with this comment.
        Expand that code fold back. 
        EXPECTED RESULT: The code fold should exist and work properly. 

*PASS* Strangely enough, for this the code folding suddenly works!
Comment 1 Petr Pisl 2011-03-14 15:38:42 UTC
I can not reproduce it. The code folding for php functions in php web page works for me. Could you attach a example source? Thanks.
Comment 2 Vladimir Riha 2011-03-14 15:44:39 UTC
I tried to reproduce it in older build since right now I don't have the newest one, but it works fine. I'll try with the latest version this evening
Comment 3 Vladimir Riha 2011-03-14 19:43:33 UTC
Created attachment 106989 [details]
folding
Comment 4 Vladimir Riha 2011-03-14 19:44:06 UTC
The newest available build for me is right now the same as Maghiel used and this works fine in both php file and php web page, see the screenshot

Product Version: NetBeans IDE 7.0 RC1 (Build 201103120000)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
System: Windows 7 version 6.1 running on x86; Cp1250; cs_CZ (nb)
Comment 5 Petr Pisl 2011-03-15 07:15:34 UTC
What is weired for me is that the class fold is treated as tag fold. But this is a result of the fix for issue #179462. 

I'm closing this issue as works for me. Please be free to reopen and attach a screenshot or source file, where it doesn't work correctly. Thanks.
Comment 6 Vladimir Riha 2011-04-05 09:41:34 UTC
Unfortunately, I have to reopen this issue. I don't know why but once I had to reopen the file to make it working but mostly it works just fine. The folds that are in new Php web page were shown but new folds for php code wasn't. It happened to me just once while doing Sanity Test where is a lot of attempts so I'll lower priority.

And because it's quite rare bug, I'm not able to reproduce it.
This was in the php code:
     <?php
      

        /**
         * Doc
         * @param type $oes 
         */
        function moje($oes) {


            $pes = 2;
//    $pes;
        }

        class Foo {
            
        }
        ?>

But again, I wasn't able to reproduce it with the same code...

Product Version: NetBeans IDE 7.0 RC2 (Build 201104050000)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
Comment 7 Petr Pisl 2011-06-09 14:46:04 UTC
I'm marking this as works for me. Feel free to reopen, when you run into again. A reproducible case would be great.