Uploaded image for project: 'Aptana Studio'
  1. Aptana Studio
  2. APSTUD-3615

Comments inside the switch construct

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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code