Details

      Description

      When I have the following code (un-indented on purpose):

      <?php
      $test = 'modeA';
      switch($test)
      {
      case 'modeA':
      // Do something
      break;
      case 'modeB':
      // Do other thing
      break;
      default:	// This includes the X option too
      // Do default thing
      break;
      }
      ?>
      

      It should format like this:

      <?php
      $test = 'modeA';
      switch($test)
      {
      	case 'modeA':
      		// Do something
      		break;
      	case 'modeB':
      		// Do other thing
      		break;
      	default:	// This includes the X option too
      		// Do default thing
      		break;
      }
      

      But it gets formatted like this instead:

      <?php
      $test = 'modeA';
      switch($test)
      {
      	case 'modeA':
      	// Do something
      		break;
      	case 'modeB':
      	// Do other thing
      		break;
      	default:
      	// This includes the X option too
      	// Do default thing
      		break;
      }
      

      Apparently it's not "allowed" to have comments in the same line as the 'case', but this would be helpful as one can include info on what it should match. The comments inside the case should be aligned to where the code is aligned (one tab to the right of the case word).

        Activity

        Hide
        sgibly Shalom Gibly added a comment -

        Fixed on 'development' (3.1)

        Show
        sgibly Shalom Gibly added a comment - Fixed on 'development' (3.1)
        Hide
        axelitus Axel Pardemann added a comment - - edited

        Just testing it today it's only half resolved, I tried the test code and it formats like this:

        <?php
        $test = 'modeA';
        switch($test)
        {
        	case 'modeA':
        		// Do something
        		break;
        	case 'modeB':
        		// Do other thing
        		break;
        	default:
        		// This includes the X option too
        		// Do default thing
        		break;
        }
        ?>
        

        Which is partially ok as the "case same line comment" is still pushed to the next line instead of just leaving it there as a comment for the case block.

        Show
        axelitus Axel Pardemann added a comment - - edited Just testing it today it's only half resolved, I tried the test code and it formats like this: <?php $test = 'modeA'; switch($test) { case 'modeA': // Do something break; case 'modeB': // Do other thing break; default: // This includes the X option too // Do default thing break; } ?> Which is partially ok as the "case same line comment" is still pushed to the next line instead of just leaving it there as a comment for the case block.
        Hide
        cheadley Clayton Headley added a comment -

        Verified this is still happening as Axel commented. Comment lines are not left on any line with a case are moved to below the case line. If this is the expected behavior this ticket can be closed.

        Show
        cheadley Clayton Headley added a comment - Verified this is still happening as Axel commented. Comment lines are not left on any line with a case are moved to below the case line. If this is the expected behavior this ticket can be closed.
        Hide
        sgibly Shalom Gibly added a comment -

        The way I see it, is that he main issue in this ticket was resolved, and Axel's last comment can be pushed as a new 'improvement' ticket.
        Right now, the formatting acts as it was designed (moving the comment down).

        @Axel - Please add a new enhancement if you can

        Show
        sgibly Shalom Gibly added a comment - The way I see it, is that he main issue in this ticket was resolved, and Axel's last comment can be pushed as a new 'improvement' ticket. Right now, the formatting acts as it was designed (moving the comment down). @Axel - Please add a new enhancement if you can
        Hide
        axelitus Axel Pardemann added a comment - - edited

        Done! I've opened an improvement issue for this. It's the APSTUD-4465 issue.

        This can be closed then.

        Show
        axelitus Axel Pardemann added a comment - - edited Done! I've opened an improvement issue for this. It's the APSTUD-4465 issue . This can be closed then.
        Hide
        sgibly Shalom Gibly added a comment -

        Thanks!

        Show
        sgibly Shalom Gibly added a comment - Thanks!

          People

          • Assignee:
            sgibly Shalom Gibly
            Reporter:
            axelitus Axel Pardemann
          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Poker Sessions

                This issue is currently not assigned to any Poker Session.