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 268171

Summary: Broken indentation for nested elements with short array syntax
Product: php Reporter: rob006
Component: Formatting & IndentationAssignee: junichi11
Status: VERIFIED FIXED    
Severity: normal CC: amobilia, josef.sabl, junichi11, PowerKiKi, rob006, tmysik
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description rob006 2016-09-23 12:15:32 UTC
Ctrl+Shift+F creates incorrect indentation for open bracket with short array syntax.

EXPECTED:

$t = [
	[
		'test',
	],
	'test1',
	[
		'test2',
	],
	['test3'],
	array('test4'),
];


ACTUAL:

$t = [
		[
		'test',
	],
	'test1',
		[
		'test2',
	],
		['test3'],
	array('test4'),
];
Comment 1 Tomas Mysik 2016-09-23 13:02:03 UTC
Not a P2, sorry.

Thanks for reporting.
Comment 2 rob006 2016-09-23 13:33:13 UTC
Any chance to fix this in 8.2? This bug makes autoformatting practically useless - nested arrays with short array syntax are quite common in any modern project. I tested autoformatter from 8.2-RC in my projects and right now it more often mess formatting than fixing it...
Comment 3 junichi11 2016-10-09 03:09:01 UTC
I'll fix it.

Thanks.
Comment 4 junichi11 2016-10-14 03:49:11 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/df8faee2d566

Thanks.
Comment 5 Tomas Mysik 2016-10-14 06:30:27 UTC
Thanks a lot, Junichi!
Comment 6 Quality Engineering 2016-10-15 02:14:03 UTC
Integrated into 'main-silver', will be available in build *201610150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/df8faee2d566
User: Junichi Yamamoto <junichi11@netbeans.org>
Log: #268171 - Broken indentation for nested elements with short array syntax
Comment 7 Tomas Mysik 2016-10-17 12:21:28 UTC
*** Bug 268556 has been marked as a duplicate of this bug. ***
Comment 8 Tomas Mysik 2016-10-17 12:22:23 UTC
Could anyone please verify this issue using a dev build? Once verified, we can add it to the patch for NB 8.2.

Thanks!
Comment 9 rob006 2016-10-17 15:43:58 UTC
I confirm that it is fixed in netbeans-dev-201610170002.

Thanks for quick fix.
Comment 10 junichi11 2016-10-19 22:51:52 UTC
(In reply to rob006 from comment #9)
> I confirm that it is fixed in netbeans-dev-201610170002.

Thanks for your verification!
Comment 11 Tomas Mysik 2016-10-20 06:03:12 UTC
Yes, thanks a lot!
Comment 12 Tomas Mysik 2016-11-28 09:20:40 UTC
*** Bug 269142 has been marked as a duplicate of this bug. ***
Comment 13 Tomas Mysik 2016-12-03 14:09:23 UTC
Transplanted to the releases repo branch release82:

http://hg.netbeans.org/releases/rev/25f3594138e3

Thanks.
Comment 14 amobilia 2016-12-15 12:15:05 UTC
82patch1-verified