RubyMine 2018.1 Help

Documenting Source Code in RubyMine


RubyMine provides convenient features for creating documentation comments.

Documentation comments in your source code are available for the Quick Documentation Lookup and open for review on pressing Ctrl+Q.

Documentation comments can be created in accordance with the RDoc or YARD syntax.

When you create additional tags, RubyMine provides code completion that suggests the possible tag names.

RDoc support

RDoc tags are completed:

rm doc comment tags

RDoc highlighting in documentation comments can be enabled or disabled. To enable it, select the checkbox Highlight RDoc and ruby syntax in comments in the Appearance page of the editor settings.

YARD support

YARD tags are completed:

rm doc comment tags yard
  • YARD directives complete in places where methods could be defined;
  • Type annotations complete where applicable (assignments, before block vars);
  • param/return/etc. tags complete before methods, inside directive docstrings, before attr_reader/writer/accessor

HEREDOC support

Besides documentation comments in the RDoc and YARD formats, RubyMine supports HEREDOCS. This is especially useful, if you are writing large blocks of text.

For example, consider the following:

rm heredoc

If you perform run, the lines between <<-HEREDOC and HEREDOC appear in the Run tool window.

Last modified: 1 August 2018

See Also