- Place the caret before the declaration of the method you want to document.
- Press Ctrl+Slash; Ctrl+DivideCtrl+Slash; Ctrl+Divide
- Press Ctrl+SpaceCtrl+Space, and choose the desired tag from the suggestion list.
Then press Ctrl+SpaceCtrl+Space again, and choose the desired parameter name:
- Place the caret anywhere within the method you want to document, press Alt+EnterAlt+Enter, and choose Add @return tag.
The documentation comment with the @return tag is created. Specify the return type.
- Place the caret at the parameter you want to document, press Alt+EnterAlt+Enter, and choose Add @param tag.
The documentation comment with the @param tag for the selected parameter is created. Specify the parameter type.
- In a comment block, select the desired empty line and type @ or : character.
- Press Ctrl+SpaceCtrl+Space, or just wait for Code Completion to display the suggestion list:
- Select a tag from the suggestion list. For example, you can specify the parameters type, or return type.
- If a certain tag has several values, press Ctrl+SpaceCtrl+Space after the tag, and select
the desired value from the suggestion list. For example, RubyMine suggests to select the desired parameter name.
Documentation comment can be created with the dedicated action Fix Doc Comment. It can be invoked by means of Find Action command.
Press Ctrl+Shift+ACtrl+Shift+A, with the caret somewhere within a class, method, function, or field, which should be documented, and enter the action name Fix Doc String. The missing documentation stub with the corresponding tags is added. For example:
The next case lays with fixing problems in the existing documentation comments.
Note that the action has no keyboard shortcut bound with it. You can do it as described in the section Configuring Keyboard Shortcuts.
Fill Paragraph action is supported for Ruby comments. This action creates soft wraps in comments. To make use of this action, follow these steps:
- Place the caret somewhere inside a comment in Ruby class.
- Do one of the following:
- On the main menu, choose
- Press Ctrl+Shift+ACtrl+Shift+A, in the pop-up frame, type Fill Paragraph, and then press EnterEnter,