MPS 2021.3 Help

Comment and uncomment blocks of code

You can comment or uncomment the current line or selected block of source code.

Commenting feature extends to all supported file types. For the custom file types, you can define line and block comments characters, as described in the section File type associations.

Comment and uncomment lines of code

To add or remove a line comment, do one of the following:

  • From the main menu, select Code | Comment with Line Comment.

  • Press Ctrl+/.

Comment and uncomment blocks of code

To add or remove a block comment, do one of the following:

  • From the main menu, select Code | Comment with Block Comment.

  • Press Ctrl+Shift+/.

Troubleshoot

The Ctrl+Shift+/ and Ctrl+/ shortcuts currently do not not work on keyboard layouts that do not have a dedicated / key, such as some national ones.

As a workaround, you can assign another key combination for these actions:

  1. Press Ctrl+Alt+S to open the IDE settings and select Keymap.

  2. In the search field, type Comment with block comment or Comment with line comment to locate the required action on the list.

  3. Right-click the action, select Add Keyboard Shortcut, and press the necessary key combination.

    Assigning another shortcut
  4. Apply the changes and close the dialog.

For more information on how to assign new key combinations to actions, refer to Add a keyboard shortcut.

Last modified: 07 December 2021