[
https://issues.apache.org/jira/browse/NETBEANS-1643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16681465#comment-16681465
]
Christian Lenz commented on NETBEANS-1643:
------------------------------------------
The wrong code is really what I typed and called the formatting action
afterwards.
> 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: Improvement
> 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: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists