MPS 2023.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:

  • Go to Code | Comment.

  • Press Ctrl+/.

If multiple nodes should be commented or uncommented with a single action, select all the nodes that should be affected and then invoke the Comment with Line Comment action as described above.

Troubleshoot

The Ctrl+/ shortcut currently does 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 then 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 about assigning new key combinations to actions, refer to Add a keyboard shortcut.

Last modified: 07 March 2024