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.
Summary: | Better formatting of array declaration that contains object literals | ||
---|---|---|---|
Product: | javascript | Reporter: | Vladimir Riha <vriha> |
Component: | Editor | Assignee: | Petr Pisl <ppisl> |
Status: | REOPENED --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.3 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
wrong formatting
expected behaviour |
Description
Vladimir Riha
2012-07-15 16:48:56 UTC
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.
|