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.
Product Version: NetBeans IDE Dev (Build 200809300201) Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b12 System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb) In php file create followed line of code: class a{function aa(){return;}} Invoke context menu and select Format. Code will stay unchanged. Same for loops like: for($i=0;$i<10;$i++){echo $i;}
Reproducible for me. Must be a regression.
:) This is not a regression. We never had this functionality in php editor. We can add it in the next release.
So now code formatting for PHP means indentation only?
I think it would be nice to have it in 7.0
@tslota: did you fix this already or it is really a regression? this code: <? function test() { do { echo "test"; } while ($condition); } ?> is formatted correctly after invoking format on file Product Version: NetBeans IDE Dev (Build 091014) Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01
It is not a regression. PHP formatting used to be only about adjusting line indents, the functionality for splitting lines have been only introduced recently and now it covers all the original examples provided in this report. The issue stays opened cos there are still some use cases to support, e.g. breaking lines in the switch statements
ppisl is the new owner of formatting/indentation area
Product Version: NetBeans IDE Dev (Build 100301-e67431be22c5) Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01 as stated in one of lasts comments there are some issues remaining example: <? class a{function aa(){return;}} ?> format file and the result is: <? class a { function aa() { return; } } ?> should be: <? class a { function aa() { return; } } ?>
(In reply to comment #8) > Product Version: NetBeans IDE Dev (Build 100301-e67431be22c5) > Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01 > > as stated in one of lasts comments there are some issues remaining > > example: > <? class a{function aa(){return;}} ?> > > format file and the result is: > <? > > class a { > > function aa() { > return; > } > } > > ?> > > should be: > <? > class a { > function aa() { > return; > } > } > ?> taking back expected result from previous comment. should be: <? class a { function aa() { return; } } ?> blank lines are added by default, of course
It has been fixed in some previous version.
There is still problem with code formatting. Steps to reproduce: 1) Create a new PHP file 2) Copy/paste this code: <?php class a{function aa(){return;}} ?> 3) Then invoke context menu and select Format. Result: <?php class a { function aa() { return; } } ?> Should be: <?php class a { function aa() { return; } } ?> Product Version: NetBeans IDE Dev (Build 201212100001) Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b17 System: Linux version 3.2.0-34-generic running on amd64; UTF-8; en_US (nb)
It's another issue. Reported was: <?php class a{function aa(){return;}} ?> And it works properly. This: <?php class a{function aa(){return;}} ?> doesn't work, but it doesn't work in 7.2 either. Definitely not P2. I'll try to look at it soon.
I'll rather file new issue, since this old P2 is fixed. The new one is just cosmetic. Thanks. New issue #223610
See my last posts. Thanks.
verified Product Version: NetBeans IDE Dev (Build 201301170001) Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b17