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.
Consider following snippet: var bugs = [ {id: "206836", title: "Title", priority: 1 }]; This is considered as formatted (Format action does nothing). I can imagine better result, for instance: var bugs = [ {id: "206836", title: "Title", priority: 1}]; Or something like that. Product Version: NetBeans IDE Dev (Build 201207140002) Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17 System: Linux version 3.5.0-4-generic running on amd64; UTF-8; en_US (nb)
Yeah I experience the same problem. However in the preview it works :)
I am on netbeans-dev-201308122300
For your sample my result is: var bugs = [ {id: "206836", title: "Title", priority: 1 }]; If I configure wrap always for Object and Object Properties result is: var bugs = [ { id: "206836", title: "Title", priority: 1 }]; You should definitely try 201308141142. Looks like duplicate of issue #234244.
Thanks for update, it seems better now, especially if I modify the wrapping or move curly brace to the [ var bugs = [{ id: "206836", title: "Title", priority: 1 }]; then this is considered formatted, which I agree with :)
Ok, closing.
I would like to reopen this ticket, if its better to use a new ticket then tell it me :). I have similar formatting issues with object literals inside an array which is inside an object. Please see the 2 screenshots for more details.
Created attachment 147156 [details] wrong formatting The arrows show what I expected.
Created attachment 147157 [details] expected behaviour First one is ok, second one is what I got when I format the code and third is what I expect for foo.