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 186030 - Sequence Init Brackets: Don't insert spaces when it's empty!
Summary: Sequence Init Brackets: Don't insert spaces when it's empty!
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Anton Chechel
URL:
Keywords:
Depends on:
Blocks: 173487
  Show dependency tree
 
Reported: 2010-05-12 16:06 UTC by Torbjorn Norbye
Modified: 2010-05-26 12:30 UTC (History)
0 users

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 Torbjorn Norbye 2010-05-12 16:06:30 UTC
I want to have spaces inside the sequence initialization brackets just like around braces, e.g.
    def y = [ foo, bar ];

When I formatted my file I ended up with
    def y = [foo, bar];

I discovered that this is controlled by a formatting option, under Spaces -- "Sequence Init Brackets".  

So I changed it from false to true, but that had one huge problem:

Now I get spaces everywhere I have a "[]", such as in type initializations:

    function bar(bar: Bar[]): Void {
        var foo: Foo[];

gets formatted as

    function bar(bar: Bar[ ]): Void {
        var foo: Foo[ ];
Comment 1 Anton Chechel 2010-05-13 15:16:10 UTC
fixed
http://hg.netbeans.org/javafx/rev/0e3131f48660
Comment 2 Alexandr Scherbatiy 2010-05-18 09:16:25 UTC
The issue is still reproduced in build netbeans-trunk-nightly-201005170932-javafx-windows.exe 

- Select the Spaces -> "Sequence Init Brackets" option
- Format the code 
------------------------------------------------
class Bar {}

class Foo {}

function bar(bar: Bar[]): Void {
    var foo: Foo[];
}
------------------------------------------------

The result is:
------------------------------------------------
function bar(bar: Bar[ ]): Void {
    var foo: Foo[ ];
}
------------------------------------------------
Comment 3 Torbjorn Norbye 2010-05-20 18:12:32 UTC
Yes, this still happens in my files too.
Comment 4 Anton Chechel 2010-05-25 09:30:03 UTC
fixed
http://hg.netbeans.org/javafx/rev/99cdedefe47e
Comment 5 Alexandr Scherbatiy 2010-05-26 12:30:07 UTC
verified in netbeans-trunk-nightly-201005260001-javafx-windows.exe