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.
Summary: | Format doesn't work with code written in sigle line. | ||
---|---|---|---|
Product: | php | Reporter: | Michael Nazarov <michaelnazarov> |
Component: | Formatting & Indentation | Assignee: | Ondrej Brejla <obrejla> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | fzamboj, kanakmar |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Michael Nazarov
2008-09-30 13:03:18 UTC
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 |