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 253093 - Wrong formatting of short array syntax with spaces within parentheses
Summary: Wrong formatting of short array syntax with spaces within parentheses
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.0.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-21 08:47 UTC by kacer
Modified: 2016-08-15 05:39 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kacer 2015-06-21 08:47:28 UTC
There is inconsistency between formatting of construct for array in long and short syntax.

In project formatting I set for PHP language spaces "Within Parentheses" for "Array declaration".

Result of formatting:

$emptyLongArray = array();
$longArray = array( 1, 2, 3 );
$emptyShortArray = [ ];
$shortArray = [1, 2, 3 ];

What I expect:

$emptyLongArray = array();
$longArray = array( 1, 2, 3 );
$emptyShortArray = [];  // No space between square brackets.
$shortArray = [ 1, 2, 3 ];  // Space after opening square bracket.
Comment 1 kacer 2015-10-08 11:09:15 UTC
This problem is also present in NetBeans 8.1 RC.
Comment 2 kacer 2016-05-13 10:23:15 UTC
Tried nightly build of NetBeans and problem is still there.

Product Version: NetBeans IDE Dev (Build 201605120002)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Linux version 4.2.0-36-generic running on amd64; UTF-8; en_US (nb)
Comment 3 Tomas Mysik 2016-08-12 05:37:24 UTC
Should be fixed now, please verify. Thanks.

http://hg.netbeans.org/web-main/rev/222964529b79
Comment 4 Quality Engineering 2016-08-13 02:13:16 UTC
Integrated into 'main-silver', will be available in build *201608130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/222964529b79
User: Tomas Mysik <tmysik@netbeans.org>
Log: #253093 - Wrong formatting of short array syntax with spaces within parentheses
Comment 5 kacer 2016-08-15 05:09:43 UTC
Tested, works as expected. Thanks.

Product Version: NetBeans IDE Dev (Build 201608140002)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Linux version 4.4.0-34-generic running on amd64; UTF-8; en_US (nb)
Comment 6 Tomas Mysik 2016-08-15 05:39:12 UTC
Thanks for your verification.