[ 
https://issues.apache.org/jira/browse/NETBEANS-1643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christian Lenz updated NETBEANS-1643:
-------------------------------------
    Issue Type: Bug  (was: Improvement)

> Formatting in JS files for nested objects is wrong
> --------------------------------------------------
>
>                 Key: NETBEANS-1643
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-1643
>             Project: NetBeans
>          Issue Type: Bug
>          Components: javascript - Editor, javascript - Formatting & 
> Indentation
>    Affects Versions: 8.2, 10.0
>            Reporter: Christian Lenz
>            Priority: Major
>
> When I have nested objects with objects and arrays it should indent like from 
> the rules which is working, if you always create a new line inside of an 
> object or inside of an array.
> But if you opening an array and adding the opening curly bracket right after 
> your array bracket "[{" w/o adding new line, it will break the formatting, 
> for the next new line.
> Right:
> {code:javascript}
> var test = {
>     foo: [
>         {
>             bar: 2
>         }
>     ]
> };
> {code}
> Wrong:
> {code:javascript}
> var test2 = {
>     foo: [{
>             bar: 3
>         }],
>     bar: [{a: {
>                 bar: 3
>             }}]
> };
> var test3 = {
>     foo: {test: {
>             tt: 3
>         }}
> };
> {code}
> Of course the argument is, ok do it like the first one, but no, I want an 
> object inside of an array starting right after the opening array because it 
> looks nicer.
> Expected formatting:
> {code:javascript}
> var test = {
>     foo: [{
>         bar: 3
>     }],
>     bar: [{
>         a: {
>             bar: 3
>         }
>     }]
> };
> var test3 = {
>     foo: {
>         test: {
>             tt: 3
>         }
>     }
> };
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to