Source Menu

The Source menu allows you to organize your scripts by adding or removing comments and formatting the script to make it more easily viewable.

The options available from the Source menu are:

NameShortcutDescription
Toggle CommentCtrl+/
-or-
Ctrl+7
Comments or uncomments a line by adding or removing "//" characters.
Comments are used for adding text to your script to explain sections of code. Commented text will not be run as part of your code.
To use this feature, select the line and press Ctrl+/.
For more, see " Commenting Code ."
Add Block CommentCtrl+Shift+/Comments a block by adding "/*" and "*/" characters to either side of the code.
To use this feature, select the block and press Ctrl+Shift+/.
For more, see " Commenting Code ."
Remove Block CommentCtrl+Shift+\Removes a block comment.
To use this feature, place the cursor anywhere within the comment and click Ctrl+Shift+\.
For more, see " Commenting Code ."
Format DocumentCtrl+Shift+FAuto formats a script to organize it into an easily readable format.
To format your code, place your cursor anywhere within the editor view and press Ctrl+Shift+F. Appropriate line breaks and indents will be added.
You can configure your auto-formatting options through the Formatter Preferences page , accessible from Window | Preferences | PHP | Formatter. For more, see Formatting Code .
Format Active ElementsCtrl+IOnly formats selected code.
To format active elements, select the required code to format and press Ctrl+I.
Appropriate line breaks and indents will be added to the active elements.
You can configure your auto-formatting options through the Formatter Preferences page , accessible from Window | Preferences | PHP | Formatter.
For more, see Formatting Code .