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

Highlight corresponding label/loop statement for "break" and "continue".

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 11.0
    • None
    • php - Editor
    • None

    Description

      In a similar manner as with brackets highlighting (place the cursor on a bracket, the corresponding one will be highlighted), it would be useful to highlight the matching label/loop for "break" and "continue" statements.

      Take for example this (poorly written) PHP code:

      for ($i = 0; $i < 10; $i++) {
          for ($j = 0; $j < 10; $j++) {
              
              if ($i + $j == 10) {
                 continue;
      {{        }}}
              
              if ($j % 2) {
                  continue(2);
      {{        }}}
              
              echo "$i + $j", PHP_EOL;
      {{    }}}
      }

      It would be useful when highlighting each "continue" statement to visually see which loop block it references. Same with "break".

      Attachments

        Activity

          People

            Unassigned Unassigned
            kkmic Silviu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: