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.
Create a nested array in php: $testArray = array( 'subarray1' => array( 'field1' => 1, 'field2' => 2 ), 'subarray2' => array( 'field3' => 3, 'field4' => 4 ) ); Activating reformat results in: $testArray = array( 'subarray1' => array( 'field1' => 1, 'field2' => 2 ), 'subarray2' => array( 'field3' => 3, 'field4' => 4 ) ); In case the tabs are not properly transmitted: the four lines containing the 'fieldx' elements are only indented 1 tab, not two as expected, thus the sub-arrays are not indented. The expected behaviour is to have the four lines with the 'fieldx' elements indented two tabs, one for the outer array, the second for the inner array.
confirmed
For what it's worth, this feature works in 6.5 and 6.5.1.
oen more use case: <?php $this->getParser()->registerKeys( array( "test1" => "passed" )); ?> invoke formatting and the code won't change. Expected result is: <?php $this->getParser()->registerKeys( array( //4 spaces "test1" => "passed" //8 spaces )); ?> i reproduced this issue in 6.5 so I don't think it's a regression. However, mcrawford620, could you describe a bit more what exactly works in 6.5 and 6.5.1? It still might be a regression. Thanks a unit test created indent/qa/issues/168396
Sorry, I guess I was being optimistic. It looks like in 6.5.1, the formatting simply does not touch the arrays. If I already have a properly nested array, like: var $test = array( 'one' => 10, 'two' => 5, 'three' => 2, 'nested' => array( 'one', 'two', 'three', 'four', ) ); Then it remains properly nested after a format. (This is what I was seeing when I said it works in 6.5.1.) But an improperly formatted array like: var $test = array( 'one' => 10, 'two' => 5, 'three' => 2, 'nested' => array( 'one', 'two', 'three', 'four', ) ); also just stays the same.
In Version 6.8beta ... If I enter a nested array, the indention is correct. But the formatting does not use this intention. $test = array( 'key1' => '123', 'level1' => array( <- Press Enter here | <- correct position This is the formatted code: $test = array( 'key1' => '123', 'level1' => array( 'key2' => '456'));
ppisl is the new owner of formatting/indentation area
I did some fixes around formatting and indenting arrays. Now it seems to be fixed. Filip please verify.
verified Product Version: NetBeans IDE Dev (Build 100406-589c3c75a4ea)
Integrated into 'main-golden', will be available in build *201004070201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/a47b814da26c User: Petr Pisl <ppisl@netbeans.org> Log: #168396 - Incorrect formatting of nested arrays