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.
dev: Product Version: NetBeans IDE Dev (Build 2009-04-14_12-05-06 ) Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02 steps to reproduce: 1. create else if statement 2. create text after else if statement that you want to comment later 3. use ctrl+/ to comment 4. continue after comment -> here it should remain indentation before comment even if comments signs '//' are at the beginning of line. example: //USG_BUGTRACKING_Query elseif (!strcmp($message, 'USG_BUGTRACKING_QUERY')) { ... } // USG_BUGTRACKING_AUTOMATIC_REFRESH < carret jumps here will be added to unit tests.
note status whiteboard: tbd_67. This is used by NB-QA to mark bugs that are supposed to be fixed to 67fcs.
fixed with the PHP indenter rewrite, I added a unit test to prevent future regressions: http://hg.netbeans.org/web-main/rev/65b364f8cf5d http://hg.netbeans.org/web-main/rev/ff1c5f92b32d
another example in Product Version: NetBeans IDE 6.7 (Build release67-19-on-090618) Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02 initial state is ok: </tr> <?php $itineraryData = getItinerary(0); for($index=0;$index < count($itineraryData);$index++){ } ?> </table> 2. select everything in php tags and press ctrl+/ </tr> <?php // $itineraryData = getItinerary(0); // // for($index=0;$index < count($itineraryData);$index++){ // } ?> </table> 3. invoke formatting and you got comments indented to far. This should stay like in step 2, shouldn't it? </tr> <?php // $itineraryData = getItinerary(0); // // for($index=0;$index < count($itineraryData);$index++){ // } ?> </table>
upgrading to P2
We agreed with Filip that it will be implemented in the following way: 1) one line comments starting directly at the beginning of the line will not be touched by the formatted - it will assume they were created with Ctrl+/ 2) one line comments preceded by one or more white spaces will be aligned with surrounding code, e.g. if (1){ // comment foo(); } will be formatted to if (1){ // comment foo(); }
fixed & unit tested http://hg.netbeans.org/web-main/rev/6b8bbead7bc3
Integrated into 'main-golden', will be available in build *200908210201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/6b8bbead7bc3 User: Tomasz Slota <tslota@netbeans.org> Log: #162586: wrong formatting comments created using ctrl+/
added one more unit test for more complex example this issue is verified but new 173899 and 173900
Integrated into 'main-golden', will be available in build *200910091401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/7493fb185255 User: Filip Zamboj <fzamboj@netbeans.org> Log: unit test for #162586 added