Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-4598

Indentation error for the 2nd last closing bracket in JavaScript.

    XMLWordPrintableJSON

Details

    Description

      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.
      }

       

       


       

      Attachments

        1. image-2020-07-17-13-56-16-941.png
          6 kB
          Nghia Nguyen
        2. image-2020-07-17-14-09-25-087.png
          6 kB
          Nghia Nguyen

        Activity

          People

            Unassigned Unassigned
            Goliath Nghia Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: