You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Tomáš Procházka (Jira)" <ji...@apache.org> on 2021/01/03 13:02:00 UTC

[jira] [Commented] (NETBEANS-4598) Indentation error for the 2nd last closing bracket in JavaScript.

    [ https://issues.apache.org/jira/browse/NETBEANS-4598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17257743#comment-17257743 ] 

Tomáš Procházka commented on NETBEANS-4598:
-------------------------------------------

I was able to reproduce the problem in NetBeans 12.2.

> Indentation error for the 2nd last closing bracket in JavaScript.
> -----------------------------------------------------------------
>
>                 Key: NETBEANS-4598
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-4598
>             Project: NetBeans
>          Issue Type: Bug
>          Components: javascript - Formatting &amp; Indentation
>    Affects Versions: 12.0, 12.2
>         Environment: Windows 10
>            Reporter: Nghia Nguyen
>            Priority: Minor
>              Labels: Indentation
>         Attachments: image-2020-07-17-13-56-16-941.png, image-2020-07-17-14-09-25-087.png
>
>
> The indentation engine seems to not be placing the 2nd last bracket in the right place.  Even though I use the Format feature in the IDE, the indentation is not correct.  If we add for example a comment // at the end of the 2nd last closing bracket of a function, it will indent correctly.
>  
> // Indentation problem:
> {{function ABC( \{param1, param2}) {}}
>  {{    for (var i = 0; i < 1; i++) {}}
>  
> {{} // This bracket should be be pushed in to match the for.}}
>  {{}}}
>  
> {{// The following code is indenting correctly:}}
> {{class Test {}}
>  {{    static DEF( \{param1, param2}) {}}
> {{        if (true) {}}
> {{        } // By putting a comment here, it allowed the IDE to indent the block correctly.  If we remove it, the indentation will fail.}}
>  {{}}}
>  
>  
> !image-2020-07-17-14-09-25-087.png!
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

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